Class: TZInfo::TZDataRuleSet

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

Overview

A rule set (as defined by Rule name in the tz data).

Instance Attribute Summary collapse

Attributes inherited from TZDataRules

#name

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ TZDataRuleSet

Returns a new instance of TZDataRuleSet.



378
379
380
381
# File 'lib/tzinfo/tzdataparser.rb', line 378

def initialize(name)
  super
  @rules = []
end

Instance Attribute Details

#rulesObject (readonly)

:nodoc:



376
377
378
# File 'lib/tzinfo/tzdataparser.rb', line 376

def rules
  @rules
end

Instance Method Details

#add_rule(rule) ⇒ Object

Adds a new rule to the set.



384
385
386
# File 'lib/tzinfo/tzdataparser.rb', line 384

def add_rule(rule)
  @rules << rule
end

#countObject



388
389
390
# File 'lib/tzinfo/tzdataparser.rb', line 388

def count
  @rules.length
end

#eachObject



392
393
394
# File 'lib/tzinfo/tzdataparser.rb', line 392

def each
  @rules.each {|rule| yield rule}
end