Sha256: 97f8bad5897231a591717ea0701c98c7333873a59f307fcc6da6fac951651afe
Contents?: true
Size: 536 Bytes
Versions: 6
Compression:
Stored size: 536 Bytes
Contents
require 'blankslate' # Provides a context for tree transformations to run in. The context allows # accessing each of the bindings in the bindings hash as local method. # # Example: # # ctx = Context.new(:a => :b) # ctx.instance_eval do # a # => :b # end # class Parslet::Pattern::Context < BlankSlate # :nodoc: def initialize(bindings) @bindings = bindings end def method_missing(sym, *args, &block) super unless args.empty? super unless @bindings.has_key?(sym.to_sym) @bindings[sym] end end
Version data entries
6 entries across 6 versions & 1 rubygems