Class: BB::SquareBoundingBox

Inherits:
BaseBoundingBox show all
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

#max, #min, #preferred_units

Instance Method Summary collapse

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