Class: TZInfo::AbsoluteDayOfYearTransitionRule
- Inherits:
-
DayOfYearTransitionRule
- Object
- TransitionRule
- DayOfYearTransitionRule
- TZInfo::AbsoluteDayOfYearTransitionRule
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.5/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.
Instance Method Summary collapse
-
#==(r) ⇒ Boolean
(also: #eql?)
Determines if this AbsoluteDayOfYearTransitionRule is equal to another instance.
-
#initialize(day, transition_at = 0) ⇒ AbsoluteDayOfYearTransitionRule
constructor
Initializes a new AbsoluteDayOfYearTransitionRule.
-
#is_always_first_day_of_year? ⇒ Boolean
‘true` if the day specified by this transition is the first in the year (a day number of 0), otherwise `false`.
-
#is_always_last_day_of_year? ⇒ Boolean
‘false`.
Constructor Details
#initialize(day, transition_at = 0) ⇒ AbsoluteDayOfYearTransitionRule
Initializes a new TZInfo::AbsoluteDayOfYearTransitionRule.
130 131 132 133 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.5/lib/tzinfo/transition_rule.rb', line 130 def initialize(day, transition_at = 0) super(day, transition_at) raise ArgumentError, 'Invalid day' unless day >= 0 && day <= 365 end |
Instance Method Details
#==(r) ⇒ Boolean Also known as: eql?
Determines if this TZInfo::AbsoluteDayOfYearTransitionRule is equal to another instance.
153 154 155 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.5/lib/tzinfo/transition_rule.rb', line 153 def ==(r) super(r) && r.kind_of?(AbsoluteDayOfYearTransitionRule) end |
#is_always_first_day_of_year? ⇒ Boolean
Returns ‘true` if the day specified by this transition is the first in the year (a day number of 0), otherwise `false`.
137 138 139 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.5/lib/tzinfo/transition_rule.rb', line 137 def is_always_first_day_of_year? seconds == 0 end |
#is_always_last_day_of_year? ⇒ Boolean
Returns ‘false`.
142 143 144 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.5/lib/tzinfo/transition_rule.rb', line 142 def is_always_last_day_of_year? false end |