Class: GeoFaker::Point
- Inherits:
-
Object
- Object
- GeoFaker::Point
- Defined in:
- lib/geo_faker/point.rb
Instance Attribute Summary collapse
-
#lat ⇒ Object
readonly
Returns the value of attribute lat.
-
#lon ⇒ Object
readonly
Returns the value of attribute lon.
Instance Method Summary collapse
-
#initialize(lat:, lon:) ⇒ Point
constructor
A new instance of Point.
- #to_json(*opts) ⇒ Object
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
#lat ⇒ Object (readonly)
Returns the value of attribute lat.
3 4 5 |
# File 'lib/geo_faker/point.rb', line 3 def lat @lat end |
#lon ⇒ Object (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 |