Class: GoogleMapsAPI::Directions::Bounds

Inherits:
Object
  • Object
show all
Defined in:
lib/google_maps_api/directions/bounds.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(northeast, southwest) ⇒ Bounds

Returns a new instance of Bounds.



4
5
6
7
8
# File 'lib/google_maps_api/directions/bounds.rb', line 4

def initialize(northeast, southwest)
  @northeast = northeast
  @southwest = southwest
  self
end

Instance Attribute Details

#northeastObject (readonly)

Returns the value of attribute northeast.



2
3
4
# File 'lib/google_maps_api/directions/bounds.rb', line 2

def northeast
  @northeast
end

#southwestObject (readonly)

Returns the value of attribute southwest.



2
3
4
# File 'lib/google_maps_api/directions/bounds.rb', line 2

def southwest
  @southwest
end

Class Method Details

.from_hash(hash) ⇒ Object



10
11
12
13
14
# File 'lib/google_maps_api/directions/bounds.rb', line 10

def self.from_hash(hash)
  northeast = build_coordinate(hash["northeast"])
  southwest = build_coordinate(hash["southwest"])
  self.new(northeast, southwest)
end