Class: Periplus::Location

Inherits:
BingResponse show all
Defined in:
lib/periplus/location.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BingResponse

#error, #initialize

Constructor Details

This class inherits a constructor from Periplus::BingResponse

Instance Attribute Details

#addressObject

Returns the value of attribute address.



5
6
7
# File 'lib/periplus/location.rb', line 5

def address
  @address
end

#confidenceObject

Returns the value of attribute confidence.



6
7
8
# File 'lib/periplus/location.rb', line 6

def confidence
  @confidence
end

#entity_typeObject

Returns the value of attribute entity_type.



7
8
9
# File 'lib/periplus/location.rb', line 7

def entity_type
  @entity_type
end

#latitudeObject

Returns the value of attribute latitude.



3
4
5
# File 'lib/periplus/location.rb', line 3

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude.



4
5
6
# File 'lib/periplus/location.rb', line 4

def longitude
  @longitude
end

Instance Method Details

#parseObject



9
10
11
12
13
14
15
16
17
# File 'lib/periplus/location.rb', line 9

def parse
  super()

  point = @primary_resource["point"]
  @latitude, @longitude = point["coordinates"]
  @address=  @primary_resource["address"]
  @confidence = @primary_resource["confidence"].downcase.to_sym
  @entity_type = @primary_resource["entityType"].downcase.to_sym
end