Parent

Methods

Files

Parslet::Scope::Binding

Attributes

parent[R]

Public Class Methods

new(parent=nil) click to toggle source
# File lib/parslet/scope.rb, line 10
def initialize(parent=nil)
  @parent = parent
  @hash = Hash.new
end

Public Instance Methods

[](k) click to toggle source
# File lib/parslet/scope.rb, line 15
def [](k)
  @hash.has_key?(k) && @hash[k] ||
    parent && parent[k] or 
    raise NotFound
end
[]=(k,v) click to toggle source
# File lib/parslet/scope.rb, line 20
def []=(k,v)
  @hash.store(k,v)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.