Sha256: 37732cfcf730868a3aaaeff7b85b9721f42049866963d7a7b9a373649489b4ea

Contents?: true

Size: 1.35 KB

Versions: 11

Compression:

Stored size: 1.35 KB

Contents

module VoteSmart
  
  class Address < Common
    
    attr_accessor :type, :street, :city, :state, :zip
    
    set_attribute_map "type" => :type, "street" => :street, "city" => :city, "state" => :state, "zip" => :zip
    
    
    # Returns a campaign office's contact information
    def self.get_campaign can_id
      request("Address.getCampaign", "candidateId" => can_id)
    end
    
    # Returns a campaign office's contact information
    def self.get_campaign_web_address can_id
      request("Address.getCampaignWebAddress", "candidateId" => can_id)
    end
    
    # Returns a campaign office's contact information
    def self.get_campaign_by_election election_id
      request("Address.getCampaignByElection", "electionId" => election_id)
    end
    
    # Returns an incumbent office's contact information
    def self.get_office candidate_id
      request("Address.getOffice", "candidateId" => candidate_id)
    end
    
    # Returns an incumbent office's contact information
    def self.get_office_web_address can_id
      request("Address.getOfficeWebAddress", "candidateId" => can_id)
    end
    
    # Returns a (sometimes)list of offices that fit office_id and state_id
    def self.get_office_by_office_state office_id, state_id = 'NA'
      request("Address.getOfficeByOfficeState", "officeId" => office_id, "stateId" => state_id)
    end
    
  end
  
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
netroots-ruby-votesmart-0.2.0 lib/vote_smart/address.rb
netroots-ruby-votesmart-0.2.1 lib/vote_smart/address.rb
netroots-ruby-votesmart-0.2.2 lib/vote_smart/address.rb
netroots-ruby-votesmart-0.2.3 lib/vote_smart/address.rb
netroots-ruby-votesmart-0.2.4 lib/vote_smart/address.rb
votesmart-0.4.1 lib/vote_smart/address.rb
votesmart-0.4.0 lib/vote_smart/address.rb
votesmart-0.3.3 lib/vote_smart/address.rb
votesmart-0.3.2 lib/vote_smart/address.rb
votesmart-0.3.1 lib/vote_smart/address.rb
votesmart-0.3.0 lib/vote_smart/address.rb