Class: TZInfo::Data::TZDataObservance
- Inherits:
-
Object
- Object
- TZInfo::Data::TZDataObservance
- Includes:
- TZDataParserUtils
- Defined in:
- lib/tzinfo/data/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
Returns the value of attribute utc_offset.
-
#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.
791 792 793 794 795 796 |
# File 'lib/tzinfo/data/tzdataparser.rb', line 791 def initialize(utc_offset, rule_set, format, valid_until) @utc_offset = 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.
788 789 790 |
# File 'lib/tzinfo/data/tzdataparser.rb', line 788 def format @format end |
#rule_set ⇒ Object (readonly)
Returns the value of attribute rule_set.
787 788 789 |
# File 'lib/tzinfo/data/tzdataparser.rb', line 787 def rule_set @rule_set end |
#utc_offset ⇒ Object (readonly)
Returns the value of attribute utc_offset.
786 787 788 |
# File 'lib/tzinfo/data/tzdataparser.rb', line 786 def utc_offset @utc_offset end |
#valid_until ⇒ Object (readonly)
Returns the value of attribute valid_until.
789 790 791 |
# File 'lib/tzinfo/data/tzdataparser.rb', line 789 def valid_until @valid_until end |
Instance Method Details
#std_offset ⇒ Object
798 799 800 801 802 803 804 |
# File 'lib/tzinfo/data/tzdataparser.rb', line 798 def std_offset if @rule_set.kind_of?(TZDataFixedOffsetRules) @rule_set.offset else 0 end end |