Class: VoteSmart::Address
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#state ⇒ Object
Returns the value of attribute state.
-
#street ⇒ Object
Returns the value of attribute street.
-
#type ⇒ Object
Returns the value of attribute type.
-
#zip ⇒ Object
Returns the value of attribute zip.
Class Method Summary collapse
-
.get_campaign(can_id) ⇒ Object
Returns a campaign office’s contact information.
-
.get_campaign_by_election(election_id) ⇒ Object
Returns a campaign office’s contact information.
-
.get_campaign_web_address(can_id) ⇒ Object
Returns a campaign office’s contact information.
-
.get_office(candidate_id) ⇒ Object
Returns an incumbent office’s contact information.
-
.get_office_by_office_state(office_id, state_id = 'NA') ⇒ Object
Returns a (sometimes)list of offices that fit office_id and state_id.
-
.get_office_web_address(can_id) ⇒ Object
Returns an incumbent office’s contact information.
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
#city ⇒ Object
Returns the value of attribute city.
5 6 7 |
# File 'lib/vote_smart/address.rb', line 5 def city @city end |
#state ⇒ Object
Returns the value of attribute state.
5 6 7 |
# File 'lib/vote_smart/address.rb', line 5 def state @state end |
#street ⇒ Object
Returns the value of attribute street.
5 6 7 |
# File 'lib/vote_smart/address.rb', line 5 def street @street end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/vote_smart/address.rb', line 5 def type @type end |
#zip ⇒ Object
Returns the value of attribute zip.
5 6 7 |
# File 'lib/vote_smart/address.rb', line 5 def zip @zip end |
Class Method Details
.get_campaign(can_id) ⇒ Object
Returns a campaign office’s contact information
11 12 13 |
# File 'lib/vote_smart/address.rb', line 11 def self.get_campaign can_id request("Address.getCampaign", "candidateId" => can_id) end |
.get_campaign_by_election(election_id) ⇒ Object
Returns a campaign office’s contact information
21 22 23 |
# File 'lib/vote_smart/address.rb', line 21 def self.get_campaign_by_election election_id request("Address.getCampaignByElection", "electionId" => election_id) end |
.get_campaign_web_address(can_id) ⇒ Object
Returns a campaign office’s contact information
16 17 18 |
# File 'lib/vote_smart/address.rb', line 16 def self.get_campaign_web_address can_id request("Address.getCampaignWebAddress", "candidateId" => can_id) end |
.get_office(candidate_id) ⇒ Object
Returns an incumbent office’s contact information
26 27 28 |
# File 'lib/vote_smart/address.rb', line 26 def self.get_office candidate_id request("Address.getOffice", "candidateId" => candidate_id) end |
.get_office_by_office_state(office_id, state_id = 'NA') ⇒ Object
Returns a (sometimes)list of offices that fit office_id and state_id
36 37 38 |
# File 'lib/vote_smart/address.rb', line 36 def self.get_office_by_office_state office_id, state_id = 'NA' request("Address.getOfficeByOfficeState", "officeId" => office_id, "stateId" => state_id) end |
.get_office_web_address(can_id) ⇒ Object
Returns an incumbent office’s contact information
31 32 33 |
# File 'lib/vote_smart/address.rb', line 31 def self.get_office_web_address can_id request("Address.getOfficeWebAddress", "candidateId" => can_id) end |