Module: DTAS::Command
Overview
:nodoc:
Constant Summary collapse
- COMMAND_DEFAULTS =
{ "env" => {}, "command" => nil, }
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#env ⇒ Object
Returns the value of attribute env.
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
-
#spawn_at ⇒ Object
Returns the value of attribute spawn_at.
-
#to_io ⇒ Object
readonly
Returns the value of attribute to_io.
Instance Method Summary collapse
Methods included from Serialize
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
11 12 13 |
# File 'lib/dtas/command.rb', line 11 def command @command end |
#env ⇒ Object
Returns the value of attribute env.
12 13 14 |
# File 'lib/dtas/command.rb', line 12 def env @env end |
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
9 10 11 |
# File 'lib/dtas/command.rb', line 9 def pid @pid end |
#spawn_at ⇒ Object
Returns the value of attribute spawn_at.
13 14 15 |
# File 'lib/dtas/command.rb', line 13 def spawn_at @spawn_at end |
#to_io ⇒ Object (readonly)
Returns the value of attribute to_io.
10 11 12 |
# File 'lib/dtas/command.rb', line 10 def to_io @to_io end |
Instance Method Details
#command_init(defaults = {}) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/dtas/command.rb', line 20 def command_init(defaults = {}) @pid = nil @to_io = nil @spawn_at = nil COMMAND_DEFAULTS.merge(defaults).each do |k,v| v = v.dup if Hash === v || Array === v instance_variable_set("@#{k}", v) end end |
#command_string ⇒ Object
34 35 36 |
# File 'lib/dtas/command.rb', line 34 def command_string @command end |
#on_death(status) ⇒ Object
30 31 32 |
# File 'lib/dtas/command.rb', line 30 def on_death(status) @pid = nil end |