Class: VoteSmart::Address

Inherits:
Common
  • Object
show all
Defined in:
lib/vote_smart/address.rb

Instance Attribute Summary collapse

Class 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

#cityObject

Returns the value of attribute city.



5
6
7
# File 'lib/vote_smart/address.rb', line 5

def city
  @city
end

#stateObject

Returns the value of attribute state.



5
6
7
# File 'lib/vote_smart/address.rb', line 5

def state
  @state
end

#streetObject

Returns the value of attribute street.



5
6
7
# File 'lib/vote_smart/address.rb', line 5

def street
  @street
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/vote_smart/address.rb', line 5

def type
  @type
end

#zipObject

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