Sha256: a11d0fbda07e9dd7cc8f757f9be0176f61cbf2c0d0eca9e30ecf6df282fe35d1
Contents?: true
Size: 557 Bytes
Versions: 19
Compression:
Stored size: 557 Bytes
Contents
class SmartIoC::ExtraPackageContexts include SmartIoC::Args def initialize @data = {} end # @param package_name [Symbol] # @param context [Symbol] def set_context(package_name, context) check_arg(package_name, :package_name, Symbol) check_arg(context, :context, Symbol) @data[package_name] = context end def get_context(package_name) @data[package_name] || SmartIoC::Container::DEFAULT_CONTEXT end # @param package_name [Symbol] def clear_context(package_name) @data.delete(package_name) nil end end
Version data entries
19 entries across 19 versions & 1 rubygems