Module: Hilbert::Api::SigmaApi

Defined in:
lib/hilbert/api/sigma_api.rb

Class Method Summary collapse

Class Method Details

.execute(formula, var, from, to) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/hilbert/api/sigma_api.rb', line 4

def self.execute(formula, var, from, to)
  case $meta_info.lang
  # TODO: I know what you want to say.
  when :ruby
    Dydx::API.reset!
    "temp_cal_f(#{var}) <= #{formula};
     (#{from}..#{to}).inject(0) {|sum, i| sum+=temp_cal_f(i) }"
  else
    fail "List is not implemented for #{$meta_info.lang_str}"
  end
end