Class: Simple::Service::Context
- Inherits:
-
Object
- Object
- Simple::Service::Context
- Defined in:
- lib/simple/service/context.rb
Defined Under Namespace
Classes: ReadOnlyError
Instance Method Summary collapse
-
#initialize ⇒ Context
constructor
A new instance of Context.
Constructor Details
#initialize ⇒ Context
Returns a new instance of Context.
9 10 11 |
# File 'lib/simple/service/context.rb', line 9 def initialize @hsh = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args, &block) ⇒ Object (private)
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/simple/service/context.rb', line 33 def method_missing(sym, *args, &block) if block super elsif args.count == 0 && sym =~ IDENTIFIER_REGEXP self[sym] elsif args.count == 1 && sym =~ ASSIGNMENT_REGEXP self[$1.to_sym] = args.first else super end end |