Class: Binding

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

Instance Method Summary collapse

Instance Method Details

#has_local_variable?(name) ⇒ Boolean

Returns:

  • (Boolean)


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

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