Class: TZInfo::TZDataObservance

Inherits:
Object
  • Object
show all
Defined in:
lib/tzinfo/tzdataparser.rb

Overview

A observance within a zone (a line within the zone definition).

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#formatObject (readonly)

Returns the value of attribute format.



706
707
708
# File 'lib/tzinfo/tzdataparser.rb', line 706

def format
  @format
end

#rule_setObject (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_offsetObject (readonly)

:nodoc:



704
705
706
# File 'lib/tzinfo/tzdataparser.rb', line 704

def utc_offset
  @utc_offset
end

#valid_untilObject (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_offsetObject



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