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.



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

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

Instance Attribute Details

#rulesObject (readonly)

:nodoc:



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

def rules
  @rules
end

Instance Method Details

#add_rule(rule) ⇒ Object

Adds a new rule to the set.



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

def add_rule(rule)
  @rules << rule
end

#countObject



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

def count
  @rules.length
end

#eachObject



396
397
398
# File 'lib/tzinfo/tzdataparser.rb', line 396

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