Class: FastRI::StringRedirectedDisplay
- Inherits:
-
DefaultDisplay
- Object
- DefaultDisplay
- FastRI::StringRedirectedDisplay
- Defined in:
- lib/fastri/ri_service.rb
Instance Attribute Summary collapse
-
#formatter ⇒ Object
readonly
Returns the value of attribute formatter.
-
#stringio ⇒ Object
readonly
Returns the value of attribute stringio.
Instance Method Summary collapse
-
#initialize(*args) ⇒ StringRedirectedDisplay
constructor
A new instance of StringRedirectedDisplay.
- #print(*a) ⇒ Object
- #puts(*a) ⇒ Object
- #reset_stringio ⇒ Object
Methods inherited from DefaultDisplay
Constructor Details
#initialize(*args) ⇒ StringRedirectedDisplay
Returns a new instance of StringRedirectedDisplay.
31 32 33 34 |
# File 'lib/fastri/ri_service.rb', line 31 def initialize(*args) super(*args) reset_stringio end |
Instance Attribute Details
#formatter ⇒ Object (readonly)
Returns the value of attribute formatter.
30 31 32 |
# File 'lib/fastri/ri_service.rb', line 30 def formatter @formatter end |
#stringio ⇒ Object (readonly)
Returns the value of attribute stringio.
30 31 32 |
# File 'lib/fastri/ri_service.rb', line 30 def stringio @stringio end |
Instance Method Details
#print(*a) ⇒ Object
40 41 42 |
# File 'lib/fastri/ri_service.rb', line 40 def print(*a) @stringio.print(*a) end |
#puts(*a) ⇒ Object
36 37 38 |
# File 'lib/fastri/ri_service.rb', line 36 def puts(*a) @stringio.puts(*a) end |
#reset_stringio ⇒ Object
44 45 46 47 |
# File 'lib/fastri/ri_service.rb', line 44 def reset_stringio @stringio = StringIO.new("") @formatter.stringio = @stringio end |