Class: Luban::Deployment::Worker::Task
- Inherits:
-
Object
- Object
- Luban::Deployment::Worker::Task
- Defined in:
- lib/luban/deployment/worker/task.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#cmd ⇒ Object
readonly
Returns the value of attribute cmd.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(task) ⇒ Task
constructor
A new instance of Task.
- #to_h ⇒ Object
Constructor Details
#initialize(task) ⇒ Task
Returns a new instance of Task.
12 13 14 15 16 17 |
# File 'lib/luban/deployment/worker/task.rb', line 12 def initialize(task) @cmd = task[:cmd] @args = OpenStruct.new(task[:args]) @opts = OpenStruct.new(task[:opts]) @result = OpenStruct.new end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
8 9 10 |
# File 'lib/luban/deployment/worker/task.rb', line 8 def args @args end |
#cmd ⇒ Object (readonly)
Returns the value of attribute cmd.
7 8 9 |
# File 'lib/luban/deployment/worker/task.rb', line 7 def cmd @cmd end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
9 10 11 |
# File 'lib/luban/deployment/worker/task.rb', line 9 def opts @opts end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
10 11 12 |
# File 'lib/luban/deployment/worker/task.rb', line 10 def result @result end |
Instance Method Details
#to_h ⇒ Object
19 20 21 |
# File 'lib/luban/deployment/worker/task.rb', line 19 def to_h { cmd: cmd, args: args.to_h, opts: opts.to_h, result: result.to_h } end |