Class: Dato::Local::FieldType::LatLon
- Inherits:
-
Object
- Object
- Dato::Local::FieldType::LatLon
- Defined in:
- lib/dato/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.
- #values ⇒ Object
Constructor Details
#initialize(latitude, longitude) ⇒ LatLon
Returns a new instance of LatLon.
12 13 14 15 |
# File 'lib/dato/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/dato/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/dato/local/field_type/lat_lon.rb', line 6 def longitude @longitude end |
Class Method Details
.parse(value, _repo) ⇒ Object
8 9 10 |
# File 'lib/dato/local/field_type/lat_lon.rb', line 8 def self.parse(value, _repo) new(value[:latitude], value[:longitude]) end |
Instance Method Details
#values ⇒ Object
17 18 19 |
# File 'lib/dato/local/field_type/lat_lon.rb', line 17 def values [latitude, longitude] end |