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.
702 703 704 705 706 707 |
# File 'lib/tzinfo/tzdataparser.rb', line 702 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.
699 700 701 |
# File 'lib/tzinfo/tzdataparser.rb', line 699 def format @format end |
#rule_set ⇒ Object (readonly)
Returns the value of attribute rule_set.
698 699 700 |
# File 'lib/tzinfo/tzdataparser.rb', line 698 def rule_set @rule_set end |
#utc_offset ⇒ Object (readonly)
:nodoc:
697 698 699 |
# File 'lib/tzinfo/tzdataparser.rb', line 697 def utc_offset @utc_offset end |
#valid_until ⇒ Object (readonly)
Returns the value of attribute valid_until.
700 701 702 |
# File 'lib/tzinfo/tzdataparser.rb', line 700 def valid_until @valid_until end |
Instance Method Details
#std_offset ⇒ Object
709 710 711 712 713 714 715 |
# File 'lib/tzinfo/tzdataparser.rb', line 709 def std_offset if @rule_set.kind_of?(TZDataFixedOffsetRules) @rule_set.offset else 0 end end |