Class: Dhaka::ClosureHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/grammar/closure_hash.rb

Overview

A subclass of Hash with a dirty flag

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dirtyObject

: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