Class: Everyoneapi::Person
- Inherits:
-
Object
- Object
- Everyoneapi::Person
- Defined in:
- lib/everyoneapi.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
-
#name ⇒ Object
Returns the value of attribute name.
-
#state ⇒ Object
Returns the value of attribute state.
-
#street ⇒ Object
Returns the value of attribute street.
-
#zip ⇒ Object
Returns the value of attribute zip.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Person
constructor
A new instance of Person.
Constructor Details
#initialize(options = {}) ⇒ Person
Returns a new instance of Person.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/everyoneapi.rb', line 41 def initialize( = {}) unless [:data].nil? @name = [:data][:name] @street = [:data][:address] unless [:data][:location].nil? @city = [:data][:location][:city] @state = [:data][:location][:state] @zip = [:data][:location][:zip] unless [:data][:location][:geo].nil? @latitude = [:data][:location][:geo][:latitude] @longitude = [:data][:location][:geo][:longitude] end end end end |
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city.
39 40 41 |
# File 'lib/everyoneapi.rb', line 39 def city @city end |
#latitude ⇒ Object
Returns the value of attribute latitude.
39 40 41 |
# File 'lib/everyoneapi.rb', line 39 def latitude @latitude end |
#longitude ⇒ Object
Returns the value of attribute longitude.
39 40 41 |
# File 'lib/everyoneapi.rb', line 39 def longitude @longitude end |
#name ⇒ Object
Returns the value of attribute name.
39 40 41 |
# File 'lib/everyoneapi.rb', line 39 def name @name end |
#state ⇒ Object
Returns the value of attribute state.
39 40 41 |
# File 'lib/everyoneapi.rb', line 39 def state @state end |
#street ⇒ Object
Returns the value of attribute street.
39 40 41 |
# File 'lib/everyoneapi.rb', line 39 def street @street end |
#zip ⇒ Object
Returns the value of attribute zip.
39 40 41 |
# File 'lib/everyoneapi.rb', line 39 def zip @zip end |