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 332
332:     def initialize
333:       @env = []
334:       @env.unshift({})
335:     end

Public Instance Methods

[](name) click to toggle source

TODO: depth_of

     # File lib/sexp_processor.rb, line 347
347:     def [] name
348:       hash = @env.find { |closure| closure.has_key? name }
349:       hash[name] if hash
350:     end
[]=(name, val) click to toggle source
     # File lib/sexp_processor.rb, line 352
352:     def []= name, val
353:       hash = @env.find { |closure| closure.has_key? name } || @env.first
354:       hash[name] = val
355:     end
all() click to toggle source
     # File lib/sexp_processor.rb, line 337
337:     def all
338:       @env.reverse.inject { |env, scope| env.merge scope }
339:     end
depth() click to toggle source
     # File lib/sexp_processor.rb, line 341
341:     def depth
342:       @env.length
343:     end
scope() click to toggle source
     # File lib/sexp_processor.rb, line 357
357:     def scope
358:       @env.unshift({})
359:       begin
360:         yield
361:       ensure
362:         @env.shift
363:         raise "You went too far unextending env" if @env.empty?
364:       end
365:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.