Class: Pipeable::Steps::To
- Defined in:
- lib/pipeable/steps/to.rb
Overview
Delegates to a non-callable object which automatically wraps the result if necessary.
Instance Method Summary collapse
- #call(result) ⇒ Object
-
#initialize(object, message) ⇒ To
constructor
A new instance of To.
Methods included from Composable
Constructor Details
#initialize(object, message) ⇒ To
Returns a new instance of To.
9 10 11 12 13 |
# File 'lib/pipeable/steps/to.rb', line 9 def initialize(object, , **) super(**) @object = object @message = end |
Instance Method Details
#call(result) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/pipeable/steps/to.rb', line 15 def call result result.bind do |arguments| splat = Marameters.categorize object.method().parameters, arguments wrap object.public_send(, *splat.positionals, **splat.keywords, &splat.block) end end |