Class: Sexpr::Processor::Helper
- Inherits:
-
Object
- Object
- Sexpr::Processor::Helper
- Defined in:
- lib/sexpr/processor/helper.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#next_in_chain ⇒ Object
Returns the value of attribute next_in_chain.
Instance Method Summary collapse
- #call(processor, sexpr, &bl) ⇒ Object
- #on_missing(processor, sexpr) {|processor, sexpr| ... } ⇒ Object
Instance Attribute Details
#next_in_chain ⇒ Object
Returns the value of attribute next_in_chain.
5 6 7 |
# File 'lib/sexpr/processor/helper.rb', line 5 def next_in_chain @next_in_chain end |
Instance Method Details
#call(processor, sexpr, &bl) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/sexpr/processor/helper.rb', line 7 def call(processor, sexpr, &bl) meth = :"on_#{sexpr.first}" meth = :"on_missing" unless respond_to?(meth) send(meth, processor, sexpr) do |r,n| next_call(r, n, bl) end end |
#on_missing(processor, sexpr) {|processor, sexpr| ... } ⇒ Object
15 16 17 |
# File 'lib/sexpr/processor/helper.rb', line 15 def on_missing(processor, sexpr) yield(processor, sexpr) end |