Class: AstroInsight::Models::GeoLocation
- Inherits:
-
Object
- Object
- AstroInsight::Models::GeoLocation
- Defined in:
- lib/astroinsight/models/geo_location.rb
Instance Attribute Summary collapse
-
#lat ⇒ Object
Returns the value of attribute lat.
-
#lon ⇒ Object
Returns the value of attribute lon.
-
#tzone ⇒ Object
Returns the value of attribute tzone.
Instance Method Summary collapse
-
#initialize(lat:, lon:, tzone: 5.5) ⇒ GeoLocation
constructor
A new instance of GeoLocation.
- #to_h ⇒ Object
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize(lat:, lon:, tzone: 5.5) ⇒ GeoLocation
Returns a new instance of GeoLocation.
8 9 10 11 12 |
# File 'lib/astroinsight/models/geo_location.rb', line 8 def initialize(lat:, lon:, tzone: 5.5) @lat = lat.to_f @lon = lon.to_f @tzone = tzone.to_f end |
Instance Attribute Details
#lat ⇒ Object
Returns the value of attribute lat.
6 7 8 |
# File 'lib/astroinsight/models/geo_location.rb', line 6 def lat @lat end |
#lon ⇒ Object
Returns the value of attribute lon.
6 7 8 |
# File 'lib/astroinsight/models/geo_location.rb', line 6 def lon @lon end |
#tzone ⇒ Object
Returns the value of attribute tzone.
6 7 8 |
# File 'lib/astroinsight/models/geo_location.rb', line 6 def tzone @tzone end |
Instance Method Details
#to_h ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/astroinsight/models/geo_location.rb', line 14 def to_h { lat: @lat, lon: @lon, tzone: @tzone } end |
#to_json(*_args) ⇒ Object
22 23 24 |
# File 'lib/astroinsight/models/geo_location.rb', line 22 def to_json(*_args) to_h.to_json end |