Class: SignatureGenerator::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/signature_generator/context.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash = {}) ⇒ Context

Returns a new instance of Context.



6
7
8
# File 'lib/signature_generator/context.rb', line 6

def initialize(hash={})
  @internal_hash = hash
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object



14
15
16
17
18
# File 'lib/signature_generator/context.rb', line 14

def method_missing(*args)
  method_name = args.shift
  return internal_hash[method_name] if internal_hash[method_name]
  super(method_name, *args)
end

Instance Method Details

#[]=(key, val) ⇒ Object



10
11
12
# File 'lib/signature_generator/context.rb', line 10

def []=(key,val)
  internal_hash[key] = val
end