Class: Dhaka::ClosureHash
- Inherits:
-
Hash
- Object
- Hash
- Dhaka::ClosureHash
- Defined in:
- lib/grammar/closure_hash.rb
Overview
A subclass of Hash with a dirty flag
Instance Attribute Summary collapse
-
#dirty ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#initialize(&block) ⇒ ClosureHash
constructor
A new instance of ClosureHash.
- #load_set(set) ⇒ Object
Constructor Details
#initialize(&block) ⇒ ClosureHash
Returns a new instance of ClosureHash.
6 7 8 9 |
# File 'lib/grammar/closure_hash.rb', line 6 def initialize(&block) super(&block) @dirty = false end |
Instance Attribute Details
#dirty ⇒ Object
:nodoc:
5 6 7 |
# File 'lib/grammar/closure_hash.rb', line 5 def dirty @dirty end |
Instance Method Details
#load_set(set) ⇒ Object
10 11 12 |
# File 'lib/grammar/closure_hash.rb', line 10 def load_set(set) set.each {|item| self[item] = item} end |