Class: Waxx::Console::Stringy

Inherits:
StringIO
  • Object
show all
Defined in:
waxx/console.rb

Overview

Container for response output when using the console

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Stringy

Initialize with StringIO args



19
20
21
22
# File 'waxx/console.rb', line 19

def initialize(*args)
  super *args
  @out = ""
end

Instance Attribute Details

#outObject (readonly)

Returns the value of attribute out



17
18
19
# File 'waxx/console.rb', line 17

def out
  @out
end

Instance Method Details

#outputObject

Get the output



28
29
30
# File 'waxx/console.rb', line 28

def output
  @out
end

Write to the output



24
25
26
# File 'waxx/console.rb', line 24

def print(str)
  @out << str
end

#resetObject

Clear the out to run another request



32
33
34
# File 'waxx/console.rb', line 32

def reset
  @out = ""
end