Class: GeoFaker::Point

Inherits:
Object
  • Object
show all
Defined in:
lib/geo_faker/point.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lat:, lon:) ⇒ Point

Returns a new instance of Point.



5
6
7
8
# File 'lib/geo_faker/point.rb', line 5

def initialize(lat:, lon:)
  @lat = lat
  @lon = lon
end

Instance Attribute Details

#latObject (readonly)

Returns the value of attribute lat.



3
4
5
# File 'lib/geo_faker/point.rb', line 3

def lat
  @lat
end

#lonObject (readonly)

Returns the value of attribute lon.



3
4
5
# File 'lib/geo_faker/point.rb', line 3

def lon
  @lon
end

Instance Method Details

#to_json(*opts) ⇒ Object



10
11
12
13
14
15
# File 'lib/geo_faker/point.rb', line 10

def to_json(*opts)
  {
    lat: lat,
    lon: lon,
  }.to_json(opts)
end