Class: ObjectiveCommand::Datas::Composite
- Inherits:
-
ObjectiveCommand::Datas.selfself::Data
- Object
- ObjectiveCommand::Datas.selfself::Data
- ObjectiveCommand::Datas::Composite
- Defined in:
- lib/objective_command/datas/composite.rb
Instance Attribute Summary collapse
-
#contents ⇒ Object
Returns the value of attribute contents.
Instance Method Summary collapse
- #<<(data) ⇒ Object
- #each(&block) ⇒ Object
- #error ⇒ Object
-
#initialize(*contents) ⇒ Composite
constructor
A new instance of Composite.
- #input ⇒ Object
- #kill(*a, &b) ⇒ Object
- #output ⇒ Object
- #status ⇒ Object
- #waitpid ⇒ Object
Constructor Details
#initialize(*contents) ⇒ Composite
Returns a new instance of Composite.
14 15 16 17 |
# File 'lib/objective_command/datas/composite.rb', line 14 def initialize ( *contents ) super() @contents = contents.flatten end |
Instance Attribute Details
#contents ⇒ Object
Returns the value of attribute contents.
12 13 14 |
# File 'lib/objective_command/datas/composite.rb', line 12 def contents @contents end |
Instance Method Details
#<<(data) ⇒ Object
31 32 33 |
# File 'lib/objective_command/datas/composite.rb', line 31 def << ( data ) @contents << data end |
#each(&block) ⇒ Object
19 20 21 |
# File 'lib/objective_command/datas/composite.rb', line 19 def each ( &block ) @contents.each(&block) end |
#error ⇒ Object
43 44 45 |
# File 'lib/objective_command/datas/composite.rb', line 43 def error @contents.last.error end |
#input ⇒ Object
47 48 49 |
# File 'lib/objective_command/datas/composite.rb', line 47 def input @contents.first.input end |
#kill(*a, &b) ⇒ Object
27 28 29 |
# File 'lib/objective_command/datas/composite.rb', line 27 def kill ( *a, &b ) each { |x| x.kill(*a, &b) } end |
#output ⇒ Object
39 40 41 |
# File 'lib/objective_command/datas/composite.rb', line 39 def output @contents.last.output end |
#status ⇒ Object
35 36 37 |
# File 'lib/objective_command/datas/composite.rb', line 35 def status @contents.last.status end |
#waitpid ⇒ Object
23 24 25 |
# File 'lib/objective_command/datas/composite.rb', line 23 def waitpid each { |x| x.waitpid } end |