Module: Teckel::Chain::ClassMethods
- Defined in:
- lib/teckel/chain.rb
Instance Method Summary collapse
- #call(input) ⇒ Object
- #errors ⇒ Object
- #input ⇒ Object
- #output ⇒ Object
- #step(name, operation) ⇒ Object
Instance Method Details
#call(input) ⇒ Object
152 153 154 |
# File 'lib/teckel/chain.rb', line 152 def call(input) new.call!(@steps, input) end |
#errors ⇒ Object
145 146 147 148 149 150 |
# File 'lib/teckel/chain.rb', line 145 def errors @steps.each_with_object([]) do |e, m| err = e.last&.error m << err if err end end |
#input ⇒ Object
137 138 139 |
# File 'lib/teckel/chain.rb', line 137 def input @steps.first&.last&.input end |
#output ⇒ Object
141 142 143 |
# File 'lib/teckel/chain.rb', line 141 def output @steps.last&.last&.output end |
#step(name, operation) ⇒ Object
156 157 158 |
# File 'lib/teckel/chain.rb', line 156 def step(name, operation) @steps << [name, operation] end |