Class: Orchestra::DSL::StepFactory
- Inherits:
-
Object
- Object
- Orchestra::DSL::StepFactory
- 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_step ⇒ Object
- #build_step_args ⇒ Object
-
#initialize(adapter, args = {}) ⇒ StepFactory
constructor
A new instance of StepFactory.
Constructor Details
#initialize(adapter, args = {}) ⇒ StepFactory
Returns a new instance of StepFactory.
105 106 107 108 109 |
# File 'lib/orchestra/dsl/object_adapter.rb', line 105 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.
103 104 105 |
# File 'lib/orchestra/dsl/object_adapter.rb', line 103 def adapter @adapter end |
#compact ⇒ Object (readonly)
Returns the value of attribute compact.
103 104 105 |
# File 'lib/orchestra/dsl/object_adapter.rb', line 103 def compact @compact end |
#provides ⇒ Object (readonly)
Returns the value of attribute provides.
103 104 105 |
# File 'lib/orchestra/dsl/object_adapter.rb', line 103 def provides @provides end |
#thread_count ⇒ Object (readonly)
Returns the value of attribute thread_count.
103 104 105 |
# File 'lib/orchestra/dsl/object_adapter.rb', line 103 def thread_count @thread_count end |
Class Method Details
.build(*args) ⇒ Object
98 99 100 101 |
# File 'lib/orchestra/dsl/object_adapter.rb', line 98 def self.build *args instance = new *args instance.build_step end |
Instance Method Details
#build_step ⇒ Object
111 112 113 114 |
# File 'lib/orchestra/dsl/object_adapter.rb', line 111 def build_step adapter.validate! Step::ObjectStep.new adapter, build_step_args end |
#build_step_args ⇒ Object
116 117 118 119 120 121 122 123 |
# File 'lib/orchestra/dsl/object_adapter.rb', line 116 def build_step_args hsh = { :dependencies => adapter.dependencies, :provides => Array(provides), } hsh[:collection] = adapter.collection if adapter.collection? hsh end |