class SmartCore::Injection::Locator

@api private @since 0.1.0

Attributes

container_proxy[R]

@return [SmartCore::Injection::Locator::ContainerProxy]

@api private @since 0.1.0

dependency[R]

@return [SmartCore::Injection::Locator::Dependency]

@api private @since 0.1.0

import_path[R]

@return [String]

@api private @since 0.1.0

Public Class Methods

new(import_path, container_proxy) click to toggle source

@param import_path [String] @param container_proxy [SmartCore::Injection::Locator::ContainerProxy] @return [void]

@api private @since 0.1.0

# File lib/smart_core/injection/locator.rb, line 22
def initialize(import_path, container_proxy)
  @import_path = import_path
  @container_proxy = container_proxy
  @dependency = SmartCore::Injection::Locator::Dependency.new
end

Public Instance Methods

bind!()
Alias for: resolve_dependency
rebind!()
Alias for: rebind_dependency
rebind_dependency() click to toggle source

@return [Any]

@api private @since 0.1.0

# File lib/smart_core/injection/locator.rb, line 41
def rebind_dependency
  dependency.rebind { container_proxy.resolve_dependency(import_path) }
end
Also aliased as: rebind!
resolve_dependency() click to toggle source

@return [Any]

@api private @since 0.1.0

# File lib/smart_core/injection/locator.rb, line 32
def resolve_dependency
  dependency.bind { container_proxy.resolve_dependency(import_path) }
end
Also aliased as: bind!