Class: Copland::Instantiator::Identity

Inherits:
Abstract
  • Object
show all
Defined in:
lib/copland/instantiator/identity.rb

Overview

This trivial instantiator simply returns the definition that was given when it was created. Hence, it is a kind of “identity” operation. This kind of instantiator is only available programmatically–it cannot be specified in a descriptor file. It is used (for example) to back the “copland.Registry” service point by always returning the registry itself when the point is instantiated.

Instance Attribute Summary

Attributes inherited from Abstract

#definition, #point

Instance Method Summary collapse

Methods inherited from Abstract

#initialize, register_as, #validate!

Constructor Details

This class inherits a constructor from Copland::Instantiator::Abstract

Instance Method Details

#instantiateObject

Simply returns the definition data that was given when the instantiator was created.



49
50
51
# File 'lib/copland/instantiator/identity.rb', line 49

def instantiate
  definition
end