Module: Taro::DeclarationsMap

Extended by:
Enumerable
Defined in:
lib/taro/declarations.rb

Class Method Summary collapse

Class Method Details

.[](key) ⇒ Object



10
11
12
# File 'lib/taro/declarations.rb', line 10

def [](key)
  map[key]
end

.[]=(key, declaration) ⇒ Object



14
15
16
17
# File 'lib/taro/declarations.rb', line 14

def []=(key, declaration)
  map.key?(key) && raise(Taro::InvariantError, "#{key} already declared")
  map[key] = declaration
end

.eachObject



19
20
21
# File 'lib/taro/declarations.rb', line 19

def each(&)
  map.each_value(&)
end

.resetObject



23
24
25
# File 'lib/taro/declarations.rb', line 23

def reset
  map.clear
end