Class: TZInfo::TZDataActivatedRule

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

Overview

An instance of a rule for a year.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rule, year) ⇒ TZDataActivatedRule

Returns a new instance of TZDataActivatedRule.



916
917
918
919
920
# File 'lib/tzinfo/tzdataparser.rb', line 916

def initialize(rule, year)
  @rule = rule
  @year = year
  @at = nil
end

Instance Attribute Details

#atObject (readonly)

Returns the value of attribute at.



914
915
916
# File 'lib/tzinfo/tzdataparser.rb', line 914

def at
  @at
end

#ruleObject (readonly)

:nodoc:



912
913
914
# File 'lib/tzinfo/tzdataparser.rb', line 912

def rule
  @rule
end

#yearObject (readonly)

Returns the value of attribute year.



913
914
915
# File 'lib/tzinfo/tzdataparser.rb', line 913

def year
  @year
end

Instance Method Details

#calculate_time(utc_offset, std_offset) ⇒ Object



922
923
924
# File 'lib/tzinfo/tzdataparser.rb', line 922

def calculate_time(utc_offset, std_offset)
  @at = @rule.at_utc_time(@year, utc_offset, std_offset)
end