Sha256: f5509e7ec56da88ce505a5abe272f1cfcc82a42fde81076033c4230e8d2096c3

Contents?: true

Size: 378 Bytes

Versions: 43

Compression:

Stored size: 378 Bytes

Contents

module Contentful
  # Location Field Type
  # You can directly query for them: https://www.contentful.com/developers/documentation/content-delivery-api/#search-filter-geo
  class Location
    attr_reader :lat, :lon
    alias latitude lat
    alias longitude lon

    def initialize(json)
      @lat = json.fetch('lat', nil)
      @lon = json.fetch('lon', nil)
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
contentful-2.17.1 lib/contentful/location.rb
contentful-2.17.0 lib/contentful/location.rb
contentful-2.16.3 lib/contentful/location.rb
contentful-2.16.2 lib/contentful/location.rb
contentful-2.16.1 lib/contentful/location.rb
contentful-2.16.0 lib/contentful/location.rb
contentful-2.15.4 lib/contentful/location.rb
contentful-2.15.3 lib/contentful/location.rb
contentful-2.15.2 lib/contentful/location.rb
contentful-2.15.1 lib/contentful/location.rb
contentful-2.15.0 lib/contentful/location.rb
contentful-2.14.0 lib/contentful/location.rb
contentful-2.13.3 lib/contentful/location.rb
contentful-2.13.2 lib/contentful/location.rb
contentful-2.13.1 lib/contentful/location.rb
contentful-2.13.0 lib/contentful/location.rb
contentful-2.12.0 lib/contentful/location.rb
contentful-2.11.1 lib/contentful/location.rb
contentful-2.11.0 lib/contentful/location.rb
contentful-2.10.1 lib/contentful/location.rb