Class: TZInfo::Data::TZDataRuleSet
- Inherits:
-
TZDataRules
- Object
- TZDataRules
- TZInfo::Data::TZDataRuleSet
- Defined in:
- lib/tzinfo/data/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.
448 449 450 451 |
# File 'lib/tzinfo/data/tzdataparser.rb', line 448 def initialize(name) super @rules = [] end |
Instance Attribute Details
#rules ⇒ Object (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 |
#count ⇒ Object
458 459 460 |
# File 'lib/tzinfo/data/tzdataparser.rb', line 458 def count @rules.length end |
#each ⇒ Object
462 463 464 |
# File 'lib/tzinfo/data/tzdataparser.rb', line 462 def each @rules.each {|rule| yield rule} end |