Class: SignatureGenerator::Context
- Inherits:
-
Object
- Object
- SignatureGenerator::Context
- Defined in:
- lib/signature_generator/context.rb
Instance Method Summary collapse
- #[]=(key, val) ⇒ Object
-
#initialize(hash = {}) ⇒ Context
constructor
A new instance of Context.
- #method_missing(*args) ⇒ Object
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 |