Module: Surrounded
- Defined in:
- lib/surrounded.rb,
lib/surrounded/context.rb,
lib/surrounded/version.rb,
lib/surrounded/context_errors.rb,
lib/surrounded/context/role_map.rb,
lib/surrounded/context/negotiator.rb
Defined Under Namespace
Modules: Context, Contextual
Classes: NullContext
Constant Summary
collapse
- VERSION =
"0.5.0"
Class Method Summary
collapse
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object
50
51
52
|
# File 'lib/surrounded.rb', line 50
def method_missing(meth, *args, &block)
context.role?(meth){} || super
end
|
Class Method Details
.create_surroundings(obj) ⇒ Object
38
39
40
|
# File 'lib/surrounded.rb', line 38
def self.create_surroundings(obj)
obj.instance_variable_set(:@__surroundings__, [])
end
|
.extended(object) ⇒ Object
.included(klass) ⇒ Object
Instance Method Details
#remove_context ⇒ Object
32
33
34
|
# File 'lib/surrounded.rb', line 32
def remove_context
surroundings.shift
end
|
#store_context(ctxt) ⇒ Object
28
29
30
|
# File 'lib/surrounded.rb', line 28
def store_context(ctxt)
surroundings.unshift(ctxt)
end
|