Class: TZInfo::TZDataObservance
- Inherits:
-
Object
- Object
- TZInfo::TZDataObservance
- Defined in:
- lib/tzinfo/tzdataparser.rb
Overview
A observance within a zone (a line within the zone definition).
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#rule_set ⇒ Object
readonly
Returns the value of attribute rule_set.
-
#utc_offset ⇒ Object
readonly
:nodoc:.
-
#valid_until ⇒ Object
readonly
Returns the value of attribute valid_until.
Instance Method Summary collapse
-
#initialize(utc_offset, rule_set, format, valid_until) ⇒ TZDataObservance
constructor
A new instance of TZDataObservance.
- #std_offset ⇒ Object
Constructor Details
#initialize(utc_offset, rule_set, format, valid_until) ⇒ TZDataObservance
Returns a new instance of TZDataObservance.
709 710 711 712 713 714 |
# File 'lib/tzinfo/tzdataparser.rb', line 709 def initialize(utc_offset, rule_set, format, valid_until) @utc_offset = TZDataParser.parse_offset(utc_offset) @rule_set = rule_set @format = TZDataFormat.new(format) @valid_until = valid_until.nil? ? nil : TZDataUntil.new(valid_until) end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
706 707 708 |
# File 'lib/tzinfo/tzdataparser.rb', line 706 def format @format end |
#rule_set ⇒ Object (readonly)
Returns the value of attribute rule_set.
705 706 707 |
# File 'lib/tzinfo/tzdataparser.rb', line 705 def rule_set @rule_set end |
#utc_offset ⇒ Object (readonly)
:nodoc:
704 705 706 |
# File 'lib/tzinfo/tzdataparser.rb', line 704 def utc_offset @utc_offset end |
#valid_until ⇒ Object (readonly)
Returns the value of attribute valid_until.
707 708 709 |
# File 'lib/tzinfo/tzdataparser.rb', line 707 def valid_until @valid_until end |
Instance Method Details
#std_offset ⇒ Object
716 717 718 719 720 721 722 |
# File 'lib/tzinfo/tzdataparser.rb', line 716 def std_offset if @rule_set.kind_of?(TZDataFixedOffsetRules) @rule_set.offset else 0 end end |