Class: TZInfo::TZDataRuleSet
- Inherits:
-
TZDataRules
- Object
- TZDataRules
- TZInfo::TZDataRuleSet
- Defined in:
- lib/tzinfo/tzdataparser.rb
Overview
A rule set (as defined by Rule name in the tz data).
Instance Attribute Summary collapse
-
#rules ⇒ Object
readonly
:nodoc:.
Attributes inherited from TZDataRules
Instance Method Summary collapse
-
#add_rule(rule) ⇒ Object
Adds a new rule to the set.
- #count ⇒ Object
- #each ⇒ Object
-
#initialize(name) ⇒ TZDataRuleSet
constructor
A new instance of TZDataRuleSet.
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
#rules ⇒ Object (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 |
#count ⇒ Object
388 389 390 |
# File 'lib/tzinfo/tzdataparser.rb', line 388 def count @rules.length end |
#each ⇒ Object
392 393 394 |
# File 'lib/tzinfo/tzdataparser.rb', line 392 def each @rules.each {|rule| yield rule} end |