Class: Contentful::Location
- Inherits:
-
Object
- Object
- Contentful::Location
- Defined in:
- lib/contentful/location.rb
Overview
Location Field Type You can directly query for them: www.contentful.com/developers/documentation/content-delivery-api/#search-filter-geo
Instance Attribute Summary collapse
-
#lat ⇒ Object
(also: #latitude)
readonly
Returns the value of attribute lat.
-
#lon ⇒ Object
(also: #longitude)
readonly
Returns the value of attribute lon.
Instance Method Summary collapse
-
#initialize(json) ⇒ Location
constructor
A new instance of Location.
Constructor Details
#initialize(json) ⇒ Location
Returns a new instance of Location.
9 10 11 12 |
# File 'lib/contentful/location.rb', line 9 def initialize(json) @lat = json.fetch('lat', nil) @lon = json.fetch('lon', nil) end |
Instance Attribute Details
#lat ⇒ Object (readonly) Also known as: latitude
Returns the value of attribute lat.
5 6 7 |
# File 'lib/contentful/location.rb', line 5 def lat @lat end |
#lon ⇒ Object (readonly) Also known as: longitude
Returns the value of attribute lon.
5 6 7 |
# File 'lib/contentful/location.rb', line 5 def lon @lon end |