Method: MultiEval#methodf_missing

Defined in:
lib/formula_eval/multi_eval.rb

#methodf_missing(sym, *args, &b) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/formula_eval/multi_eval.rb', line 4

def methodf_missing(sym,*args,&b)
  # puts "multi_eval mm #{sym}"
  objs.each do |obj|
    begin
      res = obj.send(sym,*args,&b)
      if res
        #other = objs - [obj]
        # puts "success sending #{sym} to #{obj}"
        return MultiEval.new(:objs => [res])
      end
    rescue => exp
      # puts "error sending #{sym} to #{obj} #{exp.message}"
    end
  end
  objs.first.send(sym,*args,&b)
end