Class: INatGet::Data::Helper::Field::Coordinate Private
- Inherits:
-
Range
- Object
- INatGet::Data::Helper::Field
- Range
- INatGet::Data::Helper::Field::Coordinate
- Defined in:
- lib/inat-get/data/helpers/defs/coordinate.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary
Attributes inherited from INatGet::Data::Helper::Field
Instance Method Summary collapse
-
#initialize(helper, key) ⇒ Coordinate
constructor
private
A new instance of Coordinate.
- #to_api(value) ⇒ Object private
Methods inherited from Range
Methods inherited from INatGet::Data::Helper::Field
Constructor Details
#initialize(helper, key) ⇒ Coordinate
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Coordinate.
7 8 9 |
# File 'lib/inat-get/data/helpers/defs/coordinate.rb', line 7 def initialize helper, key super helper, key, Float end |
Instance Method Details
#to_api(value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/inat-get/data/helpers/defs/coordinate.rb', line 11 def to_api value if value.begin == value.end case @key when :latitude { lat: value.begin } when :longitude { lng: value.begin } end else case @key when :latitude { swlat: value.begin, nelat: value.end } when :longitude { swlng: value.begin, nelng: value.end } end end end |