Class: Renjin::Writer

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#stringObject (readonly)

Returns the value of attribute string.



58
59
60
# File 'lib/JRubyR/renjin.rb', line 58

def string
  @string
end

Instance Method Details

#closeObject



73
74
75
# File 'lib/JRubyR/renjin.rb', line 73

def close
  
end

#flushObject



69
70
71
# File 'lib/JRubyR/renjin.rb', line 69

def flush
  
end

#outputObject



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