Sha256: 1e6d1c9c66de05c12c7aa501e2a1fd8368861b193d3585a0823b351298844e2f
Contents?: true
Size: 624 Bytes
Versions: 10
Compression:
Stored size: 624 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 package_context(package_name) @data[package_name] 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
10 entries across 10 versions & 1 rubygems