Class: Pkgr::Addon::LiveStream
- Inherits:
-
Object
- Object
- Pkgr::Addon::LiveStream
- Defined in:
- lib/pkgr/addon.rb
Instance Attribute Summary collapse
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Instance Method Summary collapse
- #<<(data) ⇒ Object
-
#initialize(stream = STDOUT) ⇒ LiveStream
constructor
A new instance of LiveStream.
Constructor Details
#initialize(stream = STDOUT) ⇒ LiveStream
Returns a new instance of LiveStream.
99 100 101 |
# File 'lib/pkgr/addon.rb', line 99 def initialize(stream = STDOUT) @stream = stream end |
Instance Attribute Details
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
98 99 100 |
# File 'lib/pkgr/addon.rb', line 98 def stream @stream end |
Instance Method Details
#<<(data) ⇒ Object
103 104 105 106 107 |
# File 'lib/pkgr/addon.rb', line 103 def <<(data) data.split("\n").each do |line| stream.puts " #{line}" end end |