Class: TZInfo::AbsoluteDayOfYearTransitionRule 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 zero-based nth day of the year.
Day 0 is 1 January.
Leap days are counted. Day 59 will be 29 February on a leap year and 1 March on a non-leap year. Day 365 will be 31 December on a leap year and 1 January the following year on a non-leap year.
Class Method Summary
-
.new(day, transition_at = 0) ⇒ AbsoluteDayOfYearTransitionRule
constructor
Internal use only
Initializes a new
AbsoluteDayOfYearTransitionRule
.
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
AbsoluteDayOfYearTransitionRule
is equal to another instance. -
#eql?(r)
Alias for #==.
-
#get_day(offset, year) ⇒ Time
protected
Internal use only
Returns a
Time
representing 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 137
def is_always_first_day_of_year? seconds == 0 end
#is_always_last_day_of_year? ⇒ Boolean
(readonly)
# File 'lib/tzinfo/transition_rule.rb', line 142
def is_always_last_day_of_year? false end
Instance Method Details
#==(r) ⇒ Boolean
Also known as: #eql?
Determines if this AbsoluteDayOfYearTransitionRule
is equal to another
instance.
# File 'lib/tzinfo/transition_rule.rb', line 153
def ==(r) super(r) && r.kind_of?(AbsoluteDayOfYearTransitionRule) end
#eql?(r)
Alias for #==.
# File 'lib/tzinfo/transition_rule.rb', line 156
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.
# File 'lib/tzinfo/transition_rule.rb', line 168
def get_day(offset, year) Time.new(year, 1, 1, 0, 0, 0, offset.observed_utc_offset) + seconds end
#hash_args ⇒ Array
(protected)
# File 'lib/tzinfo/transition_rule.rb', line 173
def hash_args [AbsoluteDayOfYearTransitionRule] + super end