Class: Binding

Inherits:
Object show all
Defined in:
lib/sourcify/lib/sourcify/patches.rb

Instance Method Summary collapse

Instance Method Details

#has_local_variable?(name) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
26
# File 'lib/sourcify/lib/sourcify/patches.rb', line 23

def has_local_variable?(name)
  check_str = "local_variables.include?(#{name})"
  self.eval(check_str) rescue eval(check_str, self)
end