Class: TZInfo::Data::TZDataRuleSet

Inherits:
TZDataRules show all
Defined in:
lib/tzinfo/data/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.



448
449
450
451
# File 'lib/tzinfo/data/tzdataparser.rb', line 448

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

Instance Attribute Details

#rulesObject (readonly)

:nodoc:



446
447
448
# File 'lib/tzinfo/data/tzdataparser.rb', line 446

def rules
  @rules
end

Instance Method Details

#add_rule(rule) ⇒ Object

Adds a new rule to the set.



454
455
456
# File 'lib/tzinfo/data/tzdataparser.rb', line 454

def add_rule(rule)
  @rules << rule
end

#countObject



458
459
460
# File 'lib/tzinfo/data/tzdataparser.rb', line 458

def count
  @rules.length
end

#eachObject



462
463
464
# File 'lib/tzinfo/data/tzdataparser.rb', line 462

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