Class: Proxy::Dynflow::TaskLauncher::Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/smart_proxy_dynflow/task_launcher/abstract.rb

Direct Known Subclasses

Batch, Single

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(world, callback, options = {}) ⇒ Abstract

Returns a new instance of Abstract.



8
9
10
11
12
13
# File 'lib/smart_proxy_dynflow/task_launcher/abstract.rb', line 8

def initialize(world, callback, options = {})
  @world = world
  @callback = callback
  @options = options
  @results = {}
end

Instance Attribute Details

#callbackObject (readonly)

Returns the value of attribute callback.



6
7
8
# File 'lib/smart_proxy_dynflow/task_launcher/abstract.rb', line 6

def callback
  @callback
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/smart_proxy_dynflow/task_launcher/abstract.rb', line 6

def options
  @options
end

#resultsObject (readonly)

Returns the value of attribute results.



6
7
8
# File 'lib/smart_proxy_dynflow/task_launcher/abstract.rb', line 6

def results
  @results
end

#worldObject (readonly)

Returns the value of attribute world.



6
7
8
# File 'lib/smart_proxy_dynflow/task_launcher/abstract.rb', line 6

def world
  @world
end

Class Method Details

.input_formatObject



19
# File 'lib/smart_proxy_dynflow/task_launcher/abstract.rb', line 19

def self.input_format; end

.new_from_hash(world, hash) ⇒ Object



25
26
27
# File 'lib/smart_proxy_dynflow/task_launcher/abstract.rb', line 25

def self.new_from_hash(world, hash)
  ::Dynflow::Utils.constantize(hash[:class]).new(world, hash[:callback], hash[:options])
end

Instance Method Details

#launch!(_input) ⇒ Object

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/smart_proxy_dynflow/task_launcher/abstract.rb', line 15

def launch!(_input)
  raise NotImplementedError
end

#to_hashObject



21
22
23
# File 'lib/smart_proxy_dynflow/task_launcher/abstract.rb', line 21

def to_hash
  { :class => self.class.to_s, :callback => callback, :options => options }
end