Class: Orchestra::DSL::NodeFactory
- Inherits:
-
Object
- Object
- Orchestra::DSL::NodeFactory
- Defined in:
- lib/orchestra/dsl/object_adapter.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#compact ⇒ Object
readonly
Returns the value of attribute compact.
-
#provides ⇒ Object
readonly
Returns the value of attribute provides.
-
#thread_count ⇒ Object
readonly
Returns the value of attribute thread_count.
Class Method Summary collapse
Instance Method Summary collapse
- #build_node ⇒ Object
- #build_node_args ⇒ Object
-
#initialize(adapter, args = {}) ⇒ NodeFactory
constructor
A new instance of NodeFactory.
Constructor Details
#initialize(adapter, args = {}) ⇒ NodeFactory
Returns a new instance of NodeFactory.
97 98 99 100 101 |
# File 'lib/orchestra/dsl/object_adapter.rb', line 97 def initialize adapter, args = {} @adapter = adapter @provides, @compact, @thread_count = Util.extract_key_args args, :provides => nil, :compact => false, :thread_count => nil end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
95 96 97 |
# File 'lib/orchestra/dsl/object_adapter.rb', line 95 def adapter @adapter end |
#compact ⇒ Object (readonly)
Returns the value of attribute compact.
95 96 97 |
# File 'lib/orchestra/dsl/object_adapter.rb', line 95 def compact @compact end |
#provides ⇒ Object (readonly)
Returns the value of attribute provides.
95 96 97 |
# File 'lib/orchestra/dsl/object_adapter.rb', line 95 def provides @provides end |
#thread_count ⇒ Object (readonly)
Returns the value of attribute thread_count.
95 96 97 |
# File 'lib/orchestra/dsl/object_adapter.rb', line 95 def thread_count @thread_count end |
Class Method Details
.build(*args) ⇒ Object
90 91 92 93 |
# File 'lib/orchestra/dsl/object_adapter.rb', line 90 def self.build *args instance = new *args instance.build_node end |
Instance Method Details
#build_node ⇒ Object
103 104 105 106 |
# File 'lib/orchestra/dsl/object_adapter.rb', line 103 def build_node adapter.validate! Node::DelegateNode.new adapter, build_node_args end |
#build_node_args ⇒ Object
108 109 110 111 112 113 114 115 |
# File 'lib/orchestra/dsl/object_adapter.rb', line 108 def build_node_args hsh = { :dependencies => adapter.dependencies, :provides => Array(provides), } hsh[:collection] = adapter.collection if adapter.collection? hsh end |