Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "./eval_context"
- module Functions
- def z1
- x1*x1 + x2*x2
- end
- def z2
- x1 + x2
- end
- end
- context = EvalContext.new(Functions)
- context.load_variables("variables.json")
- puts context.functions #=> [:z1, :z2]
- puts context.variables #=> [:x1, :x2]
- puts context.z1 #=> 13
- puts context.z2 #=> 5
Add Comment
Please, Sign In to add comment