Class: AstroInsight::Models::BirthDetails
- Inherits:
-
Object
- Object
- AstroInsight::Models::BirthDetails
- Defined in:
- lib/astroinsight/models/birth_details.rb
Instance Attribute Summary collapse
-
#day ⇒ Object
Returns the value of attribute day.
-
#hour ⇒ Object
Returns the value of attribute hour.
-
#lat ⇒ Object
Returns the value of attribute lat.
-
#lon ⇒ Object
Returns the value of attribute lon.
-
#min ⇒ Object
Returns the value of attribute min.
-
#month ⇒ Object
Returns the value of attribute month.
-
#sec ⇒ Object
Returns the value of attribute sec.
-
#tzone ⇒ Object
Returns the value of attribute tzone.
-
#year ⇒ Object
Returns the value of attribute year.
Instance Method Summary collapse
-
#initialize(day:, month:, year:, hour:, min:, sec: 0, tzone: 5.5, lat: 28.6139, lon: 77.2090) ⇒ BirthDetails
constructor
A new instance of BirthDetails.
- #to_h ⇒ Object
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize(day:, month:, year:, hour:, min:, sec: 0, tzone: 5.5, lat: 28.6139, lon: 77.2090) ⇒ BirthDetails
Returns a new instance of BirthDetails.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/astroinsight/models/birth_details.rb', line 8 def initialize(day:, month:, year:, hour:, min:, sec: 0, tzone: 5.5, lat: 28.6139, lon: 77.2090) @day = day.to_i @month = month.to_i @year = year.to_i @hour = hour.to_i @min = min.to_i @sec = sec.to_i @tzone = tzone.to_f @lat = lat.to_f @lon = lon.to_f end |
Instance Attribute Details
#day ⇒ Object
Returns the value of attribute day.
6 7 8 |
# File 'lib/astroinsight/models/birth_details.rb', line 6 def day @day end |
#hour ⇒ Object
Returns the value of attribute hour.
6 7 8 |
# File 'lib/astroinsight/models/birth_details.rb', line 6 def hour @hour end |
#lat ⇒ Object
Returns the value of attribute lat.
6 7 8 |
# File 'lib/astroinsight/models/birth_details.rb', line 6 def lat @lat end |
#lon ⇒ Object
Returns the value of attribute lon.
6 7 8 |
# File 'lib/astroinsight/models/birth_details.rb', line 6 def lon @lon end |
#min ⇒ Object
Returns the value of attribute min.
6 7 8 |
# File 'lib/astroinsight/models/birth_details.rb', line 6 def min @min end |
#month ⇒ Object
Returns the value of attribute month.
6 7 8 |
# File 'lib/astroinsight/models/birth_details.rb', line 6 def month @month end |
#sec ⇒ Object
Returns the value of attribute sec.
6 7 8 |
# File 'lib/astroinsight/models/birth_details.rb', line 6 def sec @sec end |
#tzone ⇒ Object
Returns the value of attribute tzone.
6 7 8 |
# File 'lib/astroinsight/models/birth_details.rb', line 6 def tzone @tzone end |
#year ⇒ Object
Returns the value of attribute year.
6 7 8 |
# File 'lib/astroinsight/models/birth_details.rb', line 6 def year @year end |
Instance Method Details
#to_h ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/astroinsight/models/birth_details.rb', line 20 def to_h { day: @day, month: @month, year: @year, hour: @hour, min: @min, sec: @sec, tzone: @tzone, lat: @lat, lon: @lon } end |
#to_json(*_args) ⇒ Object
34 35 36 |
# File 'lib/astroinsight/models/birth_details.rb', line 34 def to_json(*_args) to_h.to_json end |