Class: TZInfo::Data::TZDataObservance

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#formatObject (readonly)

Returns the value of attribute format.



788
789
790
# File 'lib/tzinfo/data/tzdataparser.rb', line 788

def format
  @format
end

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



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