Class: BB::SquareBoundingBox
- Inherits:
-
BaseBoundingBox
- Object
- BaseBoundingBox
- BB::SquareBoundingBox
- Defined in:
- lib/bounding_boxes/square_bounding_box.rb
Overview
creates a square bounding box sides equal to side_length and southwest corner equal to lat/long
Instance Attribute Summary
Attributes inherited from BaseBoundingBox
Instance Method Summary collapse
-
#initialize(lat, long, side_length) ⇒ SquareBoundingBox
constructor
A new instance of SquareBoundingBox.
Methods inherited from BaseBoundingBox
#fetch, #height, #max_lat, #max_long, #method_missing, #min_lat, #min_long, #side_length, #width
Constructor Details
#initialize(lat, long, side_length) ⇒ SquareBoundingBox
Returns a new instance of SquareBoundingBox.
5 6 7 8 9 10 11 |
# File 'lib/bounding_boxes/square_bounding_box.rb', line 5 def initialize(lat, long, side_length) @side_length = parse_side_length(side_length) @lat = lat @long = long @min = fetch_min @max = fetch_max end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class BB::BaseBoundingBox