Sha256: 409914d65120f32a4eaffc8fd01f35252ac9b12e10fe239318229dcf4a2af6bd
Contents?: true
Size: 748 Bytes
Versions: 10
Compression:
Stored size: 748 Bytes
Contents
module Trailblazer module Operation::Railway # Call the user's steps with a differing API (inspired by Maciej Mensfeld) that # only receives keyword args. The `options` keyword is the stateful context object # # def my_step( params:, ** ) # def my_step( params:, options:, ** ) module Macaroni def self.call(user_proc) Activity::TaskBuilder::Task.new( Trailblazer::Option.build( Macaroni::Option, user_proc ), user_proc ) end class Option < Trailblazer::Option # The Option#call! method prepares the arguments. def self.call!(proc, options, *) proc.( **options.to_hash.merge( options: options ) ) end end end KwSignature = Macaroni end end
Version data entries
10 entries across 10 versions & 1 rubygems