Module: RObject::Helper::NumericDelegateR

Defined in:
lib/robject/helper.rb

Instance Method Summary collapse

Instance Method Details

#*(val) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/robject/helper.rb', line 30

def * val
  if is_robj_matrix?(val)
    if val.respond_to?(:is_robj_matrix_multiply?) && val.is_robj_matrix_multiply? &&
        self.respond_to?(:is_robj_matrix_multiply?) && self.is_robj_matrix_multiply?
      R['%*%'].call(self, val)
    else
      R[:*].call(self, val)
    end
  else
    super
  end
end

#**(val) ⇒ Object



43
44
45
# File 'lib/robject/helper.rb', line 43

def ** val
  is_robj_matrix?(val) ? R[:**].call(self, val) : super
end

#+(val) ⇒ Object



18
19
20
# File 'lib/robject/helper.rb', line 18

def + val
  is_robj_matrix?(val) ? R[:+].call(self, val) : super
end

#-(val) ⇒ Object



22
23
24
# File 'lib/robject/helper.rb', line 22

def - val
  is_robj_matrix?(val) ? R[:-].call(self, val) : super
end

#/(val) ⇒ Object



26
27
28
# File 'lib/robject/helper.rb', line 26

def / val
  is_robj_matrix?(val) ? R[:/].call(self, val) : super
end