Class: Agave::Local::FieldType::LatLon
- Inherits:
-
Object
- Object
- Agave::Local::FieldType::LatLon
- Defined in:
- lib/agave/local/field_type/lat_lon.rb
Instance Attribute Summary collapse
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(latitude, longitude) ⇒ LatLon
constructor
A new instance of LatLon.
- #to_hash(*_args) ⇒ Object
- #values ⇒ Object
Constructor Details
#initialize(latitude, longitude) ⇒ LatLon
Returns a new instance of LatLon.
12 13 14 15 |
# File 'lib/agave/local/field_type/lat_lon.rb', line 12 def initialize(latitude, longitude) @latitude = latitude @longitude = longitude end |
Instance Attribute Details
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
6 7 8 |
# File 'lib/agave/local/field_type/lat_lon.rb', line 6 def latitude @latitude end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
6 7 8 |
# File 'lib/agave/local/field_type/lat_lon.rb', line 6 def longitude @longitude end |
Class Method Details
.parse(value, _repo) ⇒ Object
8 9 10 |
# File 'lib/agave/local/field_type/lat_lon.rb', line 8 def self.parse(value, _repo) value && new(value[:latitude], value[:longitude]) end |
Instance Method Details
#to_hash(*_args) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/agave/local/field_type/lat_lon.rb', line 21 def to_hash(*_args) { latitude: latitude, longitude: longitude } end |
#values ⇒ Object
17 18 19 |
# File 'lib/agave/local/field_type/lat_lon.rb', line 17 def values [latitude, longitude] end |