Module: Kernel
- Defined in:
- lib/lite/ruby/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
7 8 9 10 11 |
# File 'lib/lite/ruby/kernel.rb', line 7 def safe_eval eval(self) rescue Exception self end |
#try_eval ⇒ Object
13 14 15 16 17 18 |
# File 'lib/lite/ruby/kernel.rb', line 13 def try_eval val = /\[\d*,?\d*,?\d*\]/.match(to_s).to_s return val if val.nil? eval(val) end |