Class: GeocoderResponse

Inherits:
Struct
  • Object
show all
Defined in:
lib/dto/geocoder/geocoder_response.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Struct

from_hash

Instance Attribute Details

#codeObject

Returns the value of attribute code

Returns:

  • (Object)

    the current value of code



1
2
3
# File 'lib/dto/geocoder/geocoder_response.rb', line 1

def code
  @code
end

#errorsObject

Returns the value of attribute errors

Returns:

  • (Object)

    the current value of errors



1
2
3
# File 'lib/dto/geocoder/geocoder_response.rb', line 1

def errors
  @errors
end

#latitudeObject

Returns the value of attribute latitude

Returns:

  • (Object)

    the current value of latitude



1
2
3
# File 'lib/dto/geocoder/geocoder_response.rb', line 1

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude

Returns:

  • (Object)

    the current value of longitude



1
2
3
# File 'lib/dto/geocoder/geocoder_response.rb', line 1

def longitude
  @longitude
end

Class Method Details

.from_array(array) ⇒ Object



2
3
4
5
6
# File 'lib/dto/geocoder/geocoder_response.rb', line 2

def self.from_array(array)
   array.collect do |geocode|
    from_hash(:code => geocode[0], :latitude => geocode[1], :longitude => geocode[2])
  end
end