Class: WLang::Scope::BindingScope

Inherits:
WLang::Scope show all
Defined in:
lib/wlang/scope/binding_scope.rb

Instance Attribute Summary

Attributes inherited from WLang::Scope

#parent, #subject

Instance Method Summary collapse

Methods inherited from WLang::Scope

chain, coerce, #evaluate, #initialize, null, #pop, #push, #root, #subjects, #with

Constructor Details

This class inherits a constructor from WLang::Scope

Instance Method Details

#fetch(key, dialect = nil, unfound = nil) ⇒ Object



5
6
7
8
9
# File 'lib/wlang/scope/binding_scope.rb', line 5

def fetch(key, dialect = nil, unfound = nil)
  subject.eval(key.to_s)
rescue NameError
  safe_parent.fetch(key, dialect, unfound)
end

#inspectObject Also known as: to_s



11
12
13
# File 'lib/wlang/scope/binding_scope.rb', line 11

def inspect
  "BindingScope(#{subject.inspect})"
end