Module: Surrounded::Context
- Defined in:
- lib/surrounded/context.rb,
lib/surrounded/context_errors.rb,
lib/surrounded/context/role_map.rb,
lib/surrounded/context/negotiator.rb
Defined Under Namespace
Modules: InstanceMethods
Classes: InvalidRole, InvalidRoleType, Negotiator, RoleMap
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.default_role_type ⇒ Object
23
24
25
|
# File 'lib/surrounded/context.rb', line 23
def self.default_role_type
@default_role_type ||= :module
end
|
.default_role_type=(type) ⇒ Object
27
28
29
|
# File 'lib/surrounded/context.rb', line 27
def self.default_role_type=(type)
@default_role_type = type
end
|
.extended(base) ⇒ Object
18
19
20
21
|
# File 'lib/surrounded/context.rb', line 18
def self.extended(base)
base.send(:include, InstanceMethods)
base.singleton_class.send(:alias_method, :setup, :initialize)
end
|
Instance Method Details
#new(*args, &block) ⇒ Object
31
32
33
34
35
36
37
|
# File 'lib/surrounded/context.rb', line 31
def new(*args, &block)
instance = allocate
instance.send(:preinitialize)
instance.send(:initialize, *args, &block)
instance.send(:postinitialize)
instance
end
|
#triggers ⇒ Object
39
40
41
|
# File 'lib/surrounded/context.rb', line 39
def triggers
@triggers.dup
end
|