Class: Rubble::Executor::Local::Output
- Inherits:
-
Object
- Object
- Rubble::Executor::Local::Output
- Defined in:
- lib/rubble/executor/local.rb
Instance Attribute Summary collapse
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
-
#log ⇒ Object
readonly
Returns the value of attribute log.
Instance Method Summary collapse
- #<<(line) ⇒ Object
- #flush ⇒ Object
-
#initialize(log) ⇒ Output
constructor
A new instance of Output.
Constructor Details
#initialize(log) ⇒ Output
Returns a new instance of Output.
29 30 31 32 33 |
# File 'lib/rubble/executor/local.rb', line 29 def initialize(log) @log = log @lines = [] @flushed = false end |
Instance Attribute Details
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
28 29 30 |
# File 'lib/rubble/executor/local.rb', line 28 def lines @lines end |
#log ⇒ Object (readonly)
Returns the value of attribute log.
27 28 29 |
# File 'lib/rubble/executor/local.rb', line 27 def log @log end |
Instance Method Details
#<<(line) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/rubble/executor/local.rb', line 34 def <<(line) @lines << line if @flushed then @log.add(line.level, line.text) end end |
#flush ⇒ Object
40 41 42 43 44 45 |
# File 'lib/rubble/executor/local.rb', line 40 def flush @lines.each do |line| @log.add(line.level, line.text) end @flushed = true end |