Sha256: 0231a439f68514680008c28899a27003c346816fd5b7df71cfcf660a6faf3c08

Contents?: true

Size: 365 Bytes

Versions: 10

Compression:

Stored size: 365 Bytes

Contents

class Predicate
  class Binder < Sexpr::Rewriter

    grammar Grammar

    def initialize(binding)
      @binding = binding
    end
    attr_reader :binding

    def on_literal(sexpr)
      lit = sexpr.last
      if lit.is_a?(Placeholder)
        [:literal, binding[lit]]
      else
        sexpr
      end
    end

    alias :on_missing :copy_and_apply

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
predicate-2.8.0 lib/predicate/processors/binder.rb
predicate-2.7.1 lib/predicate/processors/binder.rb
predicate-2.7.0 lib/predicate/processors/binder.rb
predicate-2.6.0 lib/predicate/processors/binder.rb
predicate-2.5.0 lib/predicate/processors/binder.rb
predicate-2.4.0 lib/predicate/processors/binder.rb
predicate-2.3.3 lib/predicate/processors/binder.rb
predicate-2.3.2 lib/predicate/processors/binder.rb
predicate-2.3.1 lib/predicate/processors/binder.rb
predicate-2.3.0 lib/predicate/processors/binder.rb