Sha256: bbd07ae3018478627651ac86f4481284e77e573f1f545dc2605e07c8ef4a5645

Contents?: true

Size: 593 Bytes

Versions: 4

Compression:

Stored size: 593 Bytes

Contents

# frozen_string_literal: true
module Agave
  module Local
    module FieldType
      class LatLon
        attr_reader :latitude, :longitude

        def self.parse(value, _repo)
          value && new(value[:latitude], value[:longitude])
        end

        def initialize(latitude, longitude)
          @latitude = latitude
          @longitude = longitude
        end

        def values
          [latitude, longitude]
        end

        def to_hash(*_args)
          {
            latitude: latitude,
            longitude: longitude
          }
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
agave-client-0.1.3 lib/agave/local/field_type/lat_lon.rb
agave-client-0.1.2 lib/agave/local/field_type/lat_lon.rb
agave-client-0.1.1 lib/agave/local/field_type/lat_lon.rb
agave-client-0.1.0 lib/agave/local/field_type/lat_lon.rb