Class: Functional::TopDown
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #call(a) ⇒ Object
- #end ⇒ Object
-
#initialize(start, *a, &e) ⇒ TopDown
constructor
A new instance of TopDown.
Methods inherited from Base
Constructor Details
#initialize(start, *a, &e) ⇒ TopDown
Returns a new instance of TopDown.
99 100 101 102 |
# File 'lib/functional.rb', line 99 def initialize start, *a, &e @next.call *a, &e @buffer, @start = nil, start end |
Instance Method Details
#call(a) ⇒ Object
104 105 106 107 108 109 110 111 |
# File 'lib/functional.rb', line 104 def call a if @exe.call a @next.call @buffer @buffer = @start.dup+a else @buffer += a end end |
#end ⇒ Object
113 114 115 116 |
# File 'lib/functional.rb', line 113 def end @next.call @buffer @next.end end |