Class: Everyoneapi::Person

Inherits:
Object
  • Object
show all
Defined in:
lib/everyoneapi.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options = {})
  unless options[:data].nil?
    @name = options[:data][:name]
    @street = options[:data][:address] 
    unless  options[:data][:location].nil?
      @city = options[:data][:location][:city]
      @state = options[:data][:location][:state]
      @zip = options[:data][:location][:zip]
      unless  options[:data][:location][:geo].nil?
        @latitude = options[:data][:location][:geo][:latitude]
        @longitude = options[:data][:location][:geo][:longitude]
      end
    end
  end
end

Instance Attribute Details

#cityObject

Returns the value of attribute city.



39
40
41
# File 'lib/everyoneapi.rb', line 39

def city
  @city
end

#latitudeObject

Returns the value of attribute latitude.



39
40
41
# File 'lib/everyoneapi.rb', line 39

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude.



39
40
41
# File 'lib/everyoneapi.rb', line 39

def longitude
  @longitude
end

#nameObject

Returns the value of attribute name.



39
40
41
# File 'lib/everyoneapi.rb', line 39

def name
  @name
end

#stateObject

Returns the value of attribute state.



39
40
41
# File 'lib/everyoneapi.rb', line 39

def state
  @state
end

#streetObject

Returns the value of attribute street.



39
40
41
# File 'lib/everyoneapi.rb', line 39

def street
  @street
end

#zipObject

Returns the value of attribute zip.



39
40
41
# File 'lib/everyoneapi.rb', line 39

def zip
  @zip
end