Module: Kernel

Defined in:
lib/active_object/kernel.rb

Instance Method Summary collapse

Instance Method Details

#safe_evalObject


10
11
12
13
14
# File 'lib/active_object/kernel.rb', line 10

def safe_eval
  eval(self)
rescue Exception
  self
end

#try_evalObject


16
17
18
19
20
21
# File 'lib/active_object/kernel.rb', line 16

def try_eval
  val = SANITIZE_EVAL_REGEX.match(to_s).to_s
  return if val.nil?

  eval(val)
end