Class: Renjin::Writer
- Inherits:
-
Object
- Object
- Renjin::Writer
- Defined in:
- lib/JRubyR/renjin.rb
Overview
Class Writer is necessary if we want to redirect the standard output or standar err to a Ruby String for futher processing after a Renjin script evaluation. As can be seen this class requires improvements, but it is functional
Instance Attribute Summary collapse
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
- #close ⇒ Object
- #flush ⇒ Object
-
#initialize(buffer) ⇒ Writer
constructor
A new instance of Writer.
- #output ⇒ Object
- #write(string, offset, len) ⇒ Object
Constructor Details
#initialize(buffer) ⇒ Writer
Returns a new instance of Writer.
60 61 62 |
# File 'lib/JRubyR/renjin.rb', line 60 def initialize(buffer) @string = buffer end |
Instance Attribute Details
#string ⇒ Object (readonly)
Returns the value of attribute string.
58 59 60 |
# File 'lib/JRubyR/renjin.rb', line 58 def string @string end |
Instance Method Details
#close ⇒ Object
73 74 75 |
# File 'lib/JRubyR/renjin.rb', line 73 def close end |
#flush ⇒ Object
69 70 71 |
# File 'lib/JRubyR/renjin.rb', line 69 def flush end |
#output ⇒ Object
77 78 79 |
# File 'lib/JRubyR/renjin.rb', line 77 def output puts @string end |
#write(string, offset, len) ⇒ Object
64 65 66 67 |
# File 'lib/JRubyR/renjin.rb', line 64 def write(string, offset, len) @string << string $stdout.pos = @string.length end |