Class: PrefixedIO
- Inherits:
-
Delegator
- Object
- Delegator
- PrefixedIO
- Defined in:
- lib/mkbrut/prefixed_io.rb
Instance Method Summary collapse
- #__getobj__ ⇒ Object
-
#initialize(io, prefix) ⇒ PrefixedIO
constructor
A new instance of PrefixedIO.
- #puts(*args) ⇒ Object
Constructor Details
#initialize(io, prefix) ⇒ PrefixedIO
Returns a new instance of PrefixedIO.
3 4 5 6 |
# File 'lib/mkbrut/prefixed_io.rb', line 3 def initialize(io, prefix) @io = io @prefix = "[ #{prefix} ] " end |
Instance Method Details
#__getobj__ ⇒ Object
8 |
# File 'lib/mkbrut/prefixed_io.rb', line 8 def __getobj__ = @io |
#puts(*args) ⇒ Object
10 11 12 13 14 |
# File 'lib/mkbrut/prefixed_io.rb', line 10 def puts(*args) args.each do |arg| @io.puts(@prefix + arg.to_s) end end |