Class: TheCity::Account

Inherits:
Base
  • Object
show all
Defined in:
lib/the_city/account.rb

Overview

The City church account

Instance Attribute Summary collapse

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#[], attr_reader, define_attribute_method, define_predicate_method, define_uri_method, from_response, #memoize, object_attr_reader, uri_attr_reader

Constructor Details

#initialize(attrs = {}, options = {}) ⇒ Account

Returns a new instance of Account.



15
16
17
18
# File 'lib/the_city/account.rb', line 15

def initialize(attrs={}, options={})
  super(attrs,options)
  @campuses = Array(attrs.delete(:campuses)).map {|g| TheCity::Group.new(g,options)}
end

Instance Attribute Details

#idInteger (readonly)

Returns The id associated with the church account.

Returns:

  • (Integer)

    The id associated with the church account



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/the_city/account.rb', line 11

class  < TheCity::Base
  attr_reader :name, :id, :subdomain
  object_attr_reader :Terminology, :terminology

  def initialize(attrs={}, options={})
    super(attrs,options)
    @campuses = Array(attrs.delete(:campuses)).map {|g| TheCity::Group.new(g,options)}
  end

  # Return campuses that belong to a multisite church
  #
  # @return [Array<TheCity::Group>]
  def campuses
    @campuses
  end

  def label_for(thecity_primitive)
    terminology.send(thecity_primitive.downcase.to_sym) rescue nil
  end

end

#nameString (readonly)

Returns The name of the church, ‘Grace Church’.

Returns:

  • (String)

    The name of the church, ‘Grace Church’.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/the_city/account.rb', line 11

class  < TheCity::Base
  attr_reader :name, :id, :subdomain
  object_attr_reader :Terminology, :terminology

  def initialize(attrs={}, options={})
    super(attrs,options)
    @campuses = Array(attrs.delete(:campuses)).map {|g| TheCity::Group.new(g,options)}
  end

  # Return campuses that belong to a multisite church
  #
  # @return [Array<TheCity::Group>]
  def campuses
    @campuses
  end

  def label_for(thecity_primitive)
    terminology.send(thecity_primitive.downcase.to_sym) rescue nil
  end

end

#subdomainString (readonly)

Returns The subdomain used to access this account, subdomain.onthecity.org.

Returns:

  • (String)

    The subdomain used to access this account, subdomain.onthecity.org



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/the_city/account.rb', line 11

class  < TheCity::Base
  attr_reader :name, :id, :subdomain
  object_attr_reader :Terminology, :terminology

  def initialize(attrs={}, options={})
    super(attrs,options)
    @campuses = Array(attrs.delete(:campuses)).map {|g| TheCity::Group.new(g,options)}
  end

  # Return campuses that belong to a multisite church
  #
  # @return [Array<TheCity::Group>]
  def campuses
    @campuses
  end

  def label_for(thecity_primitive)
    terminology.send(thecity_primitive.downcase.to_sym) rescue nil
  end

end

Instance Method Details

#campusesArray<TheCity::Group>

Return campuses that belong to a multisite church

Returns:



23
24
25
# File 'lib/the_city/account.rb', line 23

def campuses
  @campuses
end

#label_for(thecity_primitive) ⇒ Object



27
28
29
# File 'lib/the_city/account.rb', line 27

def label_for(thecity_primitive)
  terminology.send(thecity_primitive.downcase.to_sym) rescue nil
end