Class: RC

Inherits:
Object
  • Object
show all
Defined in:
lib/util/exec_ruby.rb

Overview


Class RC is used only as a context for all ruby chunks in the rmarkdown file. This allows for chunks to access local variables defined in other chunks.


Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRC

Returns a new instance of RC.



35
36
37
# File 'lib/util/exec_ruby.rb', line 35

def initialize
  @out_list = R.list
end

Instance Attribute Details

#out_listObject (readonly)

Returns the value of attribute out_list.



33
34
35
# File 'lib/util/exec_ruby.rb', line 33

def out_list
  @out_list
end

Instance Method Details

#get_bindingObject



47
48
49
# File 'lib/util/exec_ruby.rb', line 47

def get_binding
  binding
end

#outputs(obj) ⇒ Object



39
40
41
# File 'lib/util/exec_ruby.rb', line 39

def outputs(obj)
  @out_list = R.c(@out_list, obj)
end

#reset_outputsObject



43
44
45
# File 'lib/util/exec_ruby.rb', line 43

def reset_outputs
  @out_list = nil
end