Class: WLang::Scope::NullScope

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

Instance Attribute Summary

Attributes inherited from WLang::Scope

#parent, #subject

Instance Method Summary collapse

Methods inherited from WLang::Scope

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

Constructor Details

#initializeNullScope

Returns a new instance of NullScope.



5
6
7
# File 'lib/wlang/scope/null_scope.rb', line 5

def initialize
  super(nil)
end

Instance Method Details

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



9
10
11
# File 'lib/wlang/scope/null_scope.rb', line 9

def fetch(key, dialect = nil, unfound = nil)
  unfound ? unfound.call : throw(:fail)
end

#inspectObject Also known as: to_s



17
18
19
# File 'lib/wlang/scope/null_scope.rb', line 17

def inspect
  "NullScope"
end

#subjectsObject



13
14
15
# File 'lib/wlang/scope/null_scope.rb', line 13

def subjects
  []
end