Class: GovKit::VoteSmart::WebAddress

Inherits:
GovKit::VoteSmartResource show all
Defined in:
lib/gov_kit/vote_smart.rb

Instance Attribute Summary

Attributes inherited from Resource

#attributes, #raw_response

Class Method Summary collapse

Methods inherited from Resource

#initialize, instantiate, instantiate_collection, parse, #to_md5, #unload

Constructor Details

This class inherits a constructor from GovKit::Resource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class GovKit::Resource

Class Method Details

.find(candidate_id) ⇒ Object



76
77
78
79
80
81
82
83
84
85
86
# File 'lib/gov_kit/vote_smart.rb', line 76

def self.find(candidate_id)
  response = get("/Address.getOfficeWebAddress", :query => {"candidateId" => candidate_id})
  
  return [] if !response['webaddress']
  
  if response['webaddress']['address'].instance_of?(Array)
    parse(response['webaddress']['address'])
  else
    [ parse(response['webaddress']['address']) ]          
  end
end