Class: MyIO

Inherits:
IO
  • Object
show all
Defined in:
lib/uberspec.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io) ⇒ MyIO

Returns a new instance of MyIO.



108
109
110
111
112
# File 'lib/uberspec.rb', line 108

def initialize(io)
  super('')
  @captured = ''
  @old_io = io
end

Instance Attribute Details

#capturedObject (readonly)

Returns the value of attribute captured.



106
107
108
# File 'lib/uberspec.rb', line 106

def captured
  @captured
end

#old_ioObject (readonly)

Returns the value of attribute old_io.



105
106
107
# File 'lib/uberspec.rb', line 105

def old_io
  @old_io
end

Instance Method Details

#write(string) ⇒ Object



114
115
116
117
# File 'lib/uberspec.rb', line 114

def write(string)
  @captured = string
  super
end