Class: BB::PointBoundingBox

Inherits:
BaseBoundingBox show all
Defined in:
lib/bounding_boxes/point_bounding_box.rb

Overview

creates a bounding box that contains a circle with center of lat, long and radius of radius should be called as PointBoundingBox.new(lat, long, “radius<km || mi>”)

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, radius) ⇒ PointBoundingBox

Returns a new instance of PointBoundingBox.



6
7
8
9
10
11
12
13
# File 'lib/bounding_boxes/point_bounding_box.rb', line 6

def initialize(lat, long, radius)
  @input = {latitude: lat, longitude: long, radius: radius}
  @input_radius = parse_radius
  @input_lat = parse_lat
  @input_long = parse_long
  @max = fetch_max
  @min = fetch_min
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class BB::BaseBoundingBox