Module: ActiveDryDeps::Deps
- Defined in:
- lib/active_dry_deps/deps.rb,
lib/active_dry_deps/stub.rb
Constant Summary collapse
- VALID_NAME =
/([a-zA-Z_0-9]*)$/
- METHODS_AS_KLASS =
%w[perform_later call].freeze
Class Method Summary collapse
Class Method Details
.[](*keys, **aliases) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/active_dry_deps/deps.rb', line 15 def [](*keys, **aliases) str_methods = +'' keys.each { |resolver| str_methods << str_method(resolver, nil) } aliases.each { |alias_method, resolver| str_methods << str_method(resolver, alias_method) } m = Module.new m.module_eval(str_methods) m end |
.enable_stubs! ⇒ Object
21 22 23 |
# File 'lib/active_dry_deps/stub.rb', line 21 def self.enable_stubs! extend Stub end |
.resolve_key(key) ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/active_dry_deps/deps.rb', line 49 def resolve_key(key) if key.include?('::') ActiveDryDeps.config.inflector.underscore(key).tr('/', '.') else key end end |