Class: Predicate::Binder
- Inherits:
-
Sexpr::Rewriter
- Object
- Sexpr::Rewriter
- Predicate::Binder
- Defined in:
- lib/predicate/processors/binder.rb
Instance Attribute Summary collapse
-
#binding ⇒ Object
readonly
Returns the value of attribute binding.
Instance Method Summary collapse
-
#initialize(binding) ⇒ Binder
constructor
A new instance of Binder.
- #on_literal(sexpr) ⇒ Object
Constructor Details
#initialize(binding) ⇒ Binder
Returns a new instance of Binder.
6 7 8 |
# File 'lib/predicate/processors/binder.rb', line 6 def initialize(binding) @binding = binding end |
Instance Attribute Details
#binding ⇒ Object (readonly)
Returns the value of attribute binding.
9 10 11 |
# File 'lib/predicate/processors/binder.rb', line 9 def binding @binding end |
Instance Method Details
#on_literal(sexpr) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/predicate/processors/binder.rb', line 11 def on_literal(sexpr) lit = sexpr.last if lit.is_a?(Placeholder) [:literal, binding[lit]] else sexpr end end |