Class: Opencellid::BBox
- Inherits:
-
Object
- Object
- Opencellid::BBox
- Defined in:
- lib/opencellid/bbox.rb
Overview
A class to simplify the setting the coordinates of a bounding box while calling methods on the OpenCellId API
Instance Attribute Summary collapse
-
#latmax ⇒ Object
Returns the value of attribute latmax.
-
#latmin ⇒ Object
Returns the value of attribute latmin.
-
#lonmax ⇒ Object
Returns the value of attribute lonmax.
-
#lonmin ⇒ Object
Returns the value of attribute lonmin.
Instance Method Summary collapse
-
#initialize(latmin, lonmin, latmax, lonmax) ⇒ BBox
constructor
A new instance of BBox.
-
#to_s ⇒ String
Transforms the coordinates of this bounding box in a format suitable for the OpenCellId API.
Constructor Details
#initialize(latmin, lonmin, latmax, lonmax) ⇒ BBox
Returns a new instance of BBox.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/opencellid/bbox.rb', line 13 def initialize(latmin, lonmin, latmax, lonmax) raise ArgumentError, 'latmin must not be nil' unless latmin raise ArgumentError, 'lonmin must not be nil' unless lonmin raise ArgumentError, 'latmax must not be nil' unless latmax raise ArgumentError, 'lonmax must not be nil' unless lonmax @latmin = latmin @lonmin = lonmin @latmax = latmax @lonmax = lonmax end |
Instance Attribute Details
#latmax ⇒ Object
Returns the value of attribute latmax.
7 8 9 |
# File 'lib/opencellid/bbox.rb', line 7 def latmax @latmax end |
#latmin ⇒ Object
Returns the value of attribute latmin.
7 8 9 |
# File 'lib/opencellid/bbox.rb', line 7 def latmin @latmin end |
#lonmax ⇒ Object
Returns the value of attribute lonmax.
7 8 9 |
# File 'lib/opencellid/bbox.rb', line 7 def lonmax @lonmax end |
#lonmin ⇒ Object
Returns the value of attribute lonmin.
7 8 9 |
# File 'lib/opencellid/bbox.rb', line 7 def lonmin @lonmin end |
Instance Method Details
#to_s ⇒ String
Transforms the coordinates of this bounding box in a format suitable for the OpenCellId API
26 27 28 |
# File 'lib/opencellid/bbox.rb', line 26 def to_s "#{latmin},#{lonmin},#{latmax},#{lonmax}" end |