Class: Sexpr::Processor::Helper

Inherits:
Object
  • Object
show all
Defined in:
lib/sexpr/processor/helper.rb

Direct Known Subclasses

SexprCoercions

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#next_in_chainObject

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

Yields:

  • (processor, sexpr)


15
16
17
# File 'lib/sexpr/processor/helper.rb', line 15

def on_missing(processor, sexpr)
  yield(processor, sexpr)
end