Class: AvvoApi::Address
- Defined in:
- lib/avvo_api/address.rb
Overview
Represents an address. The following attribute MUST be set when using this model:
-
lawyer_id
This model has the following attributes:
-
id
-
address_line1
-
address_line2
-
city
-
state
-
postal_code
-
latitude
-
longitude
Constant Summary
Constants inherited from Base
Class Method Summary collapse
-
.main(params) ⇒ Object
Returns the ‘main’ address associated with the passed in professional.
Class Method Details
.main(params) ⇒ Object
Returns the ‘main’ address associated with the passed in professional. This is usually the address you want to use. params
is a hash of {:lawyer_id => lawyer.id}
or {:doctor_id => doctor.id}
25 26 27 28 29 30 31 32 |
# File 'lib/avvo_api/address.rb', line 25 def self.main(params) response = self.get(:main, params) if response && response["id"] new(params.merge(response)) elsif response && response["address"] new(params.merge(response["address"])) end end |