Class: Rink::OutputMethod::IO

Inherits:
Base show all
Defined in:
lib/rink/output_method/io.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#silenced

Instance Method Summary collapse

Methods inherited from Base

#puts, #silenced?, #write

Constructor Details

#initialize(io) ⇒ IO

Returns a new instance of IO.



6
7
8
9
# File 'lib/rink/output_method/io.rb', line 6

def initialize(io)
  super()
  @io = io
end

Instance Attribute Details

#ioObject

Returns the value of attribute io.



4
5
6
# File 'lib/rink/output_method/io.rb', line 4

def io
  @io
end

Instance Method Details

#outputObject



11
12
13
# File 'lib/rink/output_method/io.rb', line 11

def output
  @io
end


15
16
17
18
19
# File 'lib/rink/output_method/io.rb', line 15

def print(*args)
  return if silenced?
  args = args.flatten.join
  @io.print(*args)
end