Class: Payload::ExportedDefinition Private

Inherits:
Object
  • Object
show all
Defined in:
lib/payload/exported_definition.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Decorates a base definition such as ServiceResolver to provide access to private dependencies in the Container from which the definition was exported.

Used internally by DefinitionList. Use Container#export.

Instance Method Summary collapse

Constructor Details

#initialize(definition, private_definitions) ⇒ ExportedDefinition

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ExportedDefinition.



10
11
12
13
# File 'lib/payload/exported_definition.rb', line 10

def initialize(definition, private_definitions)
  @definition = definition
  @private_definitions = private_definitions
end

Instance Method Details

#==(other) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



19
20
21
22
23
# File 'lib/payload/exported_definition.rb', line 19

def ==(other)
  other.is_a?(ExportedDefinition) &&
    definition == other.definition &&
    private_definitions == other.private_definitions
end

#resolve(container) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



15
16
17
# File 'lib/payload/exported_definition.rb', line 15

def resolve(container)
  definition.resolve(container.import(private_definitions))
end