Class: Contentful::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/contentful/location.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#latObject (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

#lonObject (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