Module: Continue

Defined in:
lib/continue.rb,
lib/continue/version.rb

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.Command(&block) ⇒ Object



17
18
19
# File 'lib/continue.rb', line 17

def self.Command(&block)
  ->(s,e,v) { block.call(e,v); s.call }
end

.Run(procs, value = nil, error = nil) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/continue.rb', line 5

def self.Run(procs, value=nil, error=nil)

  run = ->(p,v,e) do
    f, *r = p
    s = -> () { run.call(r,v,e) }
    e ||= ->() { false }
    f.call(s,e,v) if f
  end

  run.call(procs, value, error)
end