Sha256: a38542ead3cb6b6ce7d309b4fe71b844a29b381497576dd483fe122f0cfc05ba

Contents?: true

Size: 884 Bytes

Versions: 4

Compression:

Stored size: 884 Bytes

Contents

# frozen_string_literal: true

# @api private
# @since 0.1.0
class SmartCore::Container::Entities::Dependency < SmartCore::Container::Entities::Base
  # @return [String]
  #
  # @api private
  # @since 0.1.0
  alias_method :dependency_name, :external_name

  # @param dependency_name [String]
  # @param dependency_definition [Proc]
  # @return [void]
  #
  # @api private
  # @since 0.1.0
  def initialize(dependency_name, dependency_definition)
    super(dependency_name)
    @dependency_definition = dependency_definition
  end

  # @param host_container [SmartCore::Container, NilClass]
  # @return [Any]
  #
  # @api private
  # @since 0.1.0
  # @version 0.8.1
  def reveal(host_container = SmartCore::Container::NO_HOST_CONTAINER)
    dependency_definition.call
  end

  private

  # @return [Proc]
  #
  # @api private
  # @since 0.1.0
  attr_reader :dependency_definition
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
smart_container-0.11.0 lib/smart_core/container/entities/dependency.rb
smart_container-0.10.0 lib/smart_core/container/entities/dependency.rb
smart_container-0.9.0 lib/smart_core/container/entities/dependency.rb
smart_container-0.8.1 lib/smart_core/container/entities/dependency.rb