class Dato::Local::FieldType::LatLon

Attributes

latitude[R]
longitude[R]

Public Class Methods

new(latitude, longitude) click to toggle source
# File lib/dato/local/field_type/lat_lon.rb, line 13
def initialize(latitude, longitude)
  @latitude = latitude
  @longitude = longitude
end
parse(value, _repo) click to toggle source
# File lib/dato/local/field_type/lat_lon.rb, line 9
def self.parse(value, _repo)
  value && new(value[:latitude], value[:longitude])
end

Public Instance Methods

to_hash(*_args) click to toggle source
# File lib/dato/local/field_type/lat_lon.rb, line 22
def to_hash(*_args)
  {
    latitude: latitude,
    longitude: longitude,
  }
end
values() click to toggle source
# File lib/dato/local/field_type/lat_lon.rb, line 18
def values
  [latitude, longitude]
end