a guest Oct 11th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- require "./eval_context"
- module Functions
- def z1
- x1*x1 + x2*x2
- def z2
- x1 + x2
- context = EvalContext.new(Functions)
- puts context.functions #=> [:z1, :z2]
- puts context.variables #=> [:x1, :x2]
- puts context.z1 #=> 13
- puts context.z2 #=> 5
RAW Paste Data