Class: WSDirector::Task
- Inherits:
-
Object
- Object
- WSDirector::Task
- Defined in:
- lib/wsdirector/task.rb
Overview
Single client operator
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#global_holder ⇒ Object
readonly
Returns the value of attribute global_holder.
Instance Method Summary collapse
-
#initialize(config, global_holder:, result:) ⇒ Task
constructor
A new instance of Task.
- #run ⇒ Object
Constructor Details
#initialize(config, global_holder:, result:) ⇒ Task
11 12 13 14 15 16 17 18 19 |
# File 'lib/wsdirector/task.rb', line 11 def initialize(config, global_holder:, result:) @ignore = config.fetch("ignore") @steps = config.fetch("steps") @global_holder = global_holder @result = result protocol_class = Protocols.get(config.fetch("protocol", "base")) @protocol = protocol_class.new(self) end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
9 10 11 |
# File 'lib/wsdirector/task.rb', line 9 def client @client end |
#global_holder ⇒ Object (readonly)
Returns the value of attribute global_holder.
9 10 11 |
# File 'lib/wsdirector/task.rb', line 9 def global_holder @global_holder end |
Instance Method Details
#run ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/wsdirector/task.rb', line 21 def run connect! steps.each(&protocol) result.succeed rescue Error => e result.failed(e.) end |