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.



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

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

Instance Attribute Details

#capturedObject (readonly)

Returns the value of attribute captured.



102
103
104
# File 'lib/uberspec.rb', line 102

def captured
  @captured
end

#old_ioObject (readonly)

Returns the value of attribute old_io.



101
102
103
# File 'lib/uberspec.rb', line 101

def old_io
  @old_io
end

Instance Method Details

#write(string) ⇒ Object



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

def write(string)
  @captured = string
  super
end