Module: Kernel

Defined in:
lib/lite/ruby/kernel.rb

Instance Method Summary collapse

Instance Method Details

#safe_evalObject

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_evalObject



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