Parent

SexpProcessor::Environment

I really hate this here, but I hate subdirs in my lib dir more... I guess it is kinda like shaving... I’ll split this out when it itches too much...

Public Class Methods

new() click to toggle source
     # File lib/sexp_processor.rb, line 352
352:     def initialize
353:       @env = []
354:       @env.unshift({})
355:     end

Public Instance Methods

[](name) click to toggle source

TODO: depth_of

     # File lib/sexp_processor.rb, line 367
367:     def [] name
368:       hash = @env.find { |closure| closure.has_key? name }
369:       hash[name] if hash
370:     end
[]=(name, val) click to toggle source
     # File lib/sexp_processor.rb, line 372
372:     def []= name, val
373:       hash = @env.find { |closure| closure.has_key? name } || @env.first
374:       hash[name] = val
375:     end
all() click to toggle source
     # File lib/sexp_processor.rb, line 357
357:     def all
358:       @env.reverse.inject { |env, scope| env.merge scope }
359:     end
depth() click to toggle source
     # File lib/sexp_processor.rb, line 361
361:     def depth
362:       @env.length
363:     end
scope() click to toggle source
     # File lib/sexp_processor.rb, line 377
377:     def scope
378:       @env.unshift({})
379:       begin
380:         yield
381:       ensure
382:         @env.shift
383:         raise "You went too far unextending env" if @env.empty?
384:       end
385:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.