Class: SmartIoC::ExtraPackageContexts
- Inherits:
-
Object
- Object
- SmartIoC::ExtraPackageContexts
show all
- Includes:
- Args
- Defined in:
- lib/smart_ioc/extra_package_contexts.rb
Instance Method Summary
collapse
Methods included from Args
#check_arg, #check_arg_any, #not_nil
Constructor Details
Returns a new instance of ExtraPackageContexts.
4
5
6
|
# File 'lib/smart_ioc/extra_package_contexts.rb', line 4
def initialize
@data = {}
end
|
Instance Method Details
#clear_context(package_name) ⇒ Object
26
27
28
29
|
# File 'lib/smart_ioc/extra_package_contexts.rb', line 26
def clear_context(package_name)
@data.delete(package_name)
nil
end
|
#get_context(package_name) ⇒ Object
21
22
23
|
# File 'lib/smart_ioc/extra_package_contexts.rb', line 21
def get_context(package_name)
@data[package_name] || SmartIoC::Container::DEFAULT_CONTEXT
end
|
#package_context(package_name) ⇒ Object
17
18
19
|
# File 'lib/smart_ioc/extra_package_contexts.rb', line 17
def package_context(package_name)
@data[package_name]
end
|
#set_context(package_name, context) ⇒ Object
10
11
12
13
14
15
|
# File 'lib/smart_ioc/extra_package_contexts.rb', line 10
def set_context(package_name, context)
check_arg(package_name, :package_name, Symbol)
check_arg(context, :context, Symbol)
@data[package_name] = context
end
|