Class: DateTime::AllLeap
- Inherits:
-
DateTimeLike
- Object
- DateTimeLike
- DateTime::AllLeap
- Extended by:
- DateTimeLikeExtension
- Defined in:
- lib/timesteps/datetime_allleap.rb,
lib/timesteps/datetime_timestep.rb
Overview
datetime class represents ‘allleap` or `366_day` calendar
Constant Summary collapse
- DPY =
Number of days per year
366
- DPM =
Numbers of days per months
[0,31,29,31,30,31,30,31,31,30,31,30,31]
- UNIX_EPOCH_IN_AJD =
Astronomical Julian day number of UNIX epoch
Rational(4891223,2)
Instance Attribute Summary
Attributes inherited from DateTimeLike
#day, #hour, #minute, #month, #offset, #year
Instance Method Summary collapse
- #leap? ⇒ Boolean
- #timeperiod(interval_spec, tz: nil, ends: "[]") ⇒ Object
- #timestep(interval_spec, tz: nil) ⇒ Object
Methods inherited from DateTimeLike
#+, #-, #<<, #<=>, #>>, #ajd, #compare_d, #compare_md, #difference_in_months, #difference_in_years, #fraction, #initialize, #inspect, #jd, #new_offset, #next_day, #next_month, #next_year, #prev_day, #prev_month, #prev_year, #second, #second_fraction, #strftime, #succ, #to_s, #wday, #yday
Constructor Details
This class inherits a constructor from DateTimeLike
Instance Method Details
#leap? ⇒ Boolean
28 29 30 |
# File 'lib/timesteps/datetime_allleap.rb', line 28 def leap? true end |
#timeperiod(interval_spec, tz: nil, ends: "[]") ⇒ Object
76 77 78 |
# File 'lib/timesteps/datetime_timestep.rb', line 76 def timeperiod (interval_spec, tz: nil, ends: "[]") return TimePeriod.new(interval_spec, since: self, calendar: "allleap", ends: ends, tz: tz) end |