Class: Orchestra::DSL::StepFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/orchestra/dsl/object_adapter.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#adapterObject (readonly)

Returns the value of attribute adapter.



103
104
105
# File 'lib/orchestra/dsl/object_adapter.rb', line 103

def adapter
  @adapter
end

#compactObject (readonly)

Returns the value of attribute compact.



103
104
105
# File 'lib/orchestra/dsl/object_adapter.rb', line 103

def compact
  @compact
end

#providesObject (readonly)

Returns the value of attribute provides.



103
104
105
# File 'lib/orchestra/dsl/object_adapter.rb', line 103

def provides
  @provides
end

#thread_countObject (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_stepObject



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_argsObject



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