diff options
Diffstat (limited to 'lib/algorithm.rb')
-rw-r--r-- | lib/algorithm.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/algorithm.rb b/lib/algorithm.rb index 1b97584..eda7588 100644 --- a/lib/algorithm.rb +++ b/lib/algorithm.rb @@ -2,9 +2,9 @@ module OpenTox module Algorithm - def self.run algorithm, arg1, arg2 #parameters + def self.run algorithm, object, parameters={} klass,method = algorithm.split('.') - Object.const_get(klass).send(method, arg1,arg2) + parameters.empty? ? Object.const_get(klass).send(method,object) : Object.const_get(klass).send(method,object, parameters) end end |