Class: AngryHash::DSL::Env

Inherits:
BasicObject
Defined in:
lib/angry_hash/dsl.rb

Instance Method Summary collapse

Methods inherited from BasicObject

#raise

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &blk) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/angry_hash/dsl.rb', line 28

def method_missing(method,*args,&blk)
  method_s = method.to_s
  if method_s[/[A-Za-z0-9]$/] && args.size == 1
    __store[method.to_s] = args.first
  else
    super
  end
end

Instance Method Details

#__storeObject



25
26
27
# File 'lib/angry_hash/dsl.rb', line 25

def __store
  @store ||= {}
end