Module: Kernel
- Defined in:
- lib/active_object/kernel.rb
Instance Method Summary collapse
-
#safe_eval ⇒ Object
rubocop:disable Lint/RescueException, Security/Eval.
- #try_eval ⇒ Object
Instance Method Details
#safe_eval ⇒ Object
rubocop:disable Lint/RescueException, Security/Eval
9 10 11 12 13 |
# File 'lib/active_object/kernel.rb', line 9 def safe_eval eval(self) rescue Exception self end |
#try_eval ⇒ Object
15 16 17 18 19 20 |
# File 'lib/active_object/kernel.rb', line 15 def try_eval val = SANITIZE_EVAL_REGEX.match(to_s).to_s return if val.nil? eval(val) end |