Class: TZInfo::JulianDayOfYearTransitionRule Private
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
|
|
|
Instance Chain:
|
|
| Inherits: |
TZInfo::DayOfYearTransitionRule
|
| Defined in: | lib/tzinfo/transition_rule.rb |
Overview
Defines transitions that occur on the one-based nth Julian day of the year.
Leap days are not counted. Day 1 is 1 January. Day 60 is always 1 March. Day 365 is always 31 December.
Constant Summary
-
LEAP =
private
# File 'lib/tzinfo/transition_rule.rb', line 186
The 60 days in seconds.
60 * 86400
-
YEAR =
private
# File 'lib/tzinfo/transition_rule.rb', line 190
The length of a non-leap year in seconds.
365 * 86400
Class Method Summary
-
.new(day, transition_at = 0) ⇒ JulianDayOfYearTransitionRule
constructor
Internal use only
Initializes a new
JulianDayOfYearTransitionRule.
DayOfYearTransitionRule - Inherited
| .new | Initializes a new |
TransitionRule - Inherited
| .new | Initializes a new |
Instance Attribute Summary
- #is_always_first_day_of_year? ⇒ Boolean readonly Internal use only
- #is_always_last_day_of_year? ⇒ Boolean readonly Internal use only
DayOfYearTransitionRule - Inherited
TransitionRule - Inherited
| #transition_at | Returns the number of seconds after midnight local time on the day identified by the rule at which the transition occurs. |
Instance Method Summary
-
#==(r) ⇒ Boolean
(also: #eql?)
Internal use only
Determines if this
JulianDayOfYearTransitionRuleis equal to another instance. -
#eql?(r)
Alias for #==.
-
#get_day(offset, year) ⇒ Time
protected
Internal use only
Returns a
Timerepresenting midnight local time on the day specified by the rule for the given offset and year. - #hash_args ⇒ Array protected Internal use only
DayOfYearTransitionRule - Inherited
| #== | Determines if this |
| #eql? | Alias for DayOfYearTransitionRule#==. |
| #hash_args | |
TransitionRule - Inherited
| #== | Determines if this |
| #at | Calculates the time of the transition from a given offset on a given year. |
| #eql? | Alias for TransitionRule#==. |
| #hash, #hash_args | |
Instance Attribute Details
#is_always_first_day_of_year? ⇒ Boolean (readonly)
# File 'lib/tzinfo/transition_rule.rb', line 209
def is_always_first_day_of_year? seconds == 86400 end
#is_always_last_day_of_year? ⇒ Boolean (readonly)
# File 'lib/tzinfo/transition_rule.rb', line 215
def is_always_last_day_of_year? seconds == YEAR end
Instance Method Details
#==(r) ⇒ Boolean
Also known as: #eql?
Determines if this JulianDayOfYearTransitionRule is equal to another
instance.
# File 'lib/tzinfo/transition_rule.rb', line 226
def ==(r) super(r) && r.kind_of?(JulianDayOfYearTransitionRule) end
#eql?(r)
Alias for #==.
# File 'lib/tzinfo/transition_rule.rb', line 229
alias eql? ==
#get_day(offset, year) ⇒ Time (protected)
Returns a Time representing midnight local time on the day specified by
the rule for the given offset and year.
#hash_args ⇒ Array (protected)
# File 'lib/tzinfo/transition_rule.rb', line 250
def hash_args [JulianDayOfYearTransitionRule] + super end