Class: VoteSmart::Office::Type
- Defined in:
- lib/vote_smart/office.rb
Instance Attribute Summary collapse
-
#branch_id ⇒ Object
Returns the value of attribute branch_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#level_id ⇒ Object
Returns the value of attribute level_id.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Common
construct_url, get_json_data, hash2get, #initialize, parallelize!, request, response_child, session, set_attribute_map, #update_attributes
Constructor Details
This class inherits a constructor from VoteSmart::Common
Instance Attribute Details
#branch_id ⇒ Object
Returns the value of attribute branch_id.
91 92 93 |
# File 'lib/vote_smart/office.rb', line 91 def branch_id @branch_id end |
#id ⇒ Object
Returns the value of attribute id.
91 92 93 |
# File 'lib/vote_smart/office.rb', line 91 def id @id end |
#level_id ⇒ Object
Returns the value of attribute level_id.
91 92 93 |
# File 'lib/vote_smart/office.rb', line 91 def level_id @level_id end |
#name ⇒ Object
Returns the value of attribute name.
91 92 93 |
# File 'lib/vote_smart/office.rb', line 91 def name @name end |
Class Method Details
Instance Method Details
#office_by_name(name) ⇒ Object
112 113 114 |
# File 'lib/vote_smart/office.rb', line 112 def office_by_name name offices_by_name([name]).first end |
#offices ⇒ Object
104 105 106 |
# File 'lib/vote_smart/office.rb', line 104 def offices @offices ||= Office.find_all_by_type(self) end |
#offices_by_name(names) ⇒ Object
108 109 110 |
# File 'lib/vote_smart/office.rb', line 108 def offices_by_name names names.collect {|name| offices.find {|office| office.name == name }} end |