daily pastebin goal
42%
SHARE
TWEET

Untitled

a guest Oct 11th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. require "./eval_context"
  2.  
  3. module Functions
  4.   def z1
  5.     x1*x1 + x2*x2
  6.   end
  7.  
  8.   def z2
  9.     x1 + x2
  10.   end
  11. end
  12.  
  13. context = EvalContext.new(Functions)
  14. context.load_variables("variables.json")
  15. puts context.functions #=> [:z1, :z2]
  16. puts context.variables #=> [:x1, :x2]
  17. puts context.z1 #=> 13
  18. puts context.z2 #=> 5
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top