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.



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

#formatObject (readonly)

Returns the value of attribute format.



699
700
701
# File 'lib/tzinfo/tzdataparser.rb', line 699

def format
  @format
end

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

:nodoc:



697
698
699
# File 'lib/tzinfo/tzdataparser.rb', line 697

def utc_offset
  @utc_offset
end

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



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