Class: ObjectiveCommand::Datas::Composite

Inherits:
ObjectiveCommand::Datas.selfself::Data
  • Object
show all
Defined in:
lib/objective_command/datas/composite.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#contentsObject

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

#errorObject



43
44
45
# File 'lib/objective_command/datas/composite.rb', line 43

def error
  @contents.last.error
end

#inputObject



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

#outputObject



39
40
41
# File 'lib/objective_command/datas/composite.rb', line 39

def output
  @contents.last.output
end

#statusObject



35
36
37
# File 'lib/objective_command/datas/composite.rb', line 35

def status
  @contents.last.status
end

#waitpidObject



23
24
25
# File 'lib/objective_command/datas/composite.rb', line 23

def waitpid
  each { |x| x.waitpid }
end