Class: Bing::RestResource
Constant Summary collapse
Instance Attribute Summary collapse
-
#bounding_box ⇒ Object
readonly
The map’s bounding box.
Class Method Summary collapse
Instance Method Summary collapse
-
#bbox(box) ⇒ Object
Decipher bounding box from bbox in Bing response.
Instance Attribute Details
#bounding_box ⇒ Object (readonly)
The map’s bounding box.
32 33 34 |
# File 'lib/bing/rest_resource.rb', line 32 def bounding_box @bounding_box end |
Class Method Details
.map_find(params) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/bing/rest_resource.rb', line 16 def self.map_find params resp = Bing::Request.get map_uri params body = JSON.parse resp.body body['resourceSets'].first['resources'].map do |resource| new resource end.compact end |
Instance Method Details
#bbox(box) ⇒ Object
Decipher bounding box from bbox in Bing response.
37 38 39 40 41 42 43 44 45 |
# File 'lib/bing/rest_resource.rb', line 37 def bbox box south, west, north, east = *box { :north => north, :east => east, :south => south, :west => west, } end |