Class: R::Language
- Includes:
- BinaryOperators, ExpBinOp, IndexedObject, LogicalOperators
- Defined in:
- lib/R_interface/rlanguage.rb
Constant Summary
Constants inherited from Object
Instance Attribute Summary collapse
-
#expression ⇒ Object
Returns the value of attribute expression.
Attributes inherited from Object
Class Method Summary collapse
Instance Method Summary collapse
Methods included from IndexedObject
Methods included from ExpBinOp
#assign, #coerce, #exec_bin_oper, #inter
Methods included from LogicalOperators
Methods included from BinaryOperators
#!=, #%, #*, #**, #+, #-, #/, #<, #<=, #>, #>=, #_, #eq, #int_div, #til
Methods inherited from Object
#==, build_class_probe_count, build_from_r_class_string, build_from_wrapper_tag, #call, class_probe_fetch_r_class, increment_build_class_probe_count!, #initialize, #inspect, #instance_of?, #instance_variable_get, #instance_variable_set, #is_a?, #method_missing, #nil?, #pretty_print, #rclass, reset_build_counters!, #respond_to?, #send, #to_ary, #to_i, #to_ruby, #typeof, #unboxed_get
Methods included from ExecUniOp
Methods included from UnaryOperators
Methods included from ExecBinOp
Constructor Details
This class inherits a constructor from R::Object
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class R::Object
Instance Attribute Details
#expression ⇒ Object
Returns the value of attribute expression.
13 14 15 |
# File 'lib/R_interface/rlanguage.rb', line 13 def expression @expression end |
Class Method Details
.build(function_name, *args) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/R_interface/rlanguage.rb', line 15 def self.build(function_name, *args) # function_name is something like '`+`' or '`~`' op = function_name.delete("`").strip lhs = ::R::Support.parse_arg(args[0]) rhs = ::R::Support.parse_arg(args[1]) r_expr = (op == ":") ? "#{lhs}#{op}#{rhs}" : "#{lhs} #{op} #{rhs}" lhs_display = ::R::Support.expression_display_arg(args[0]) rhs_display = ::R::Support.expression_display_arg(args[1]) expr_display = (op == ":") ? "#{lhs_display}#{op}#{rhs_display}" : "#{lhs_display} #{op} #{rhs_display}" res = ::R::Language.allocate res.instance_variable_set(:@r_interop, r_expr) res.expression = expr_display res end |