What is a usual step input?
A usual step input passes a symbol in
in:that matches an existing organizer instance method. Convenient Service calls that method and forwards its return value to the step under the same name.class CalculateDoubled include ConvenientService::Standard::Config attr_reader :number def initialize(number:) @number = number end def result success(doubled: number * 2) end end class AwardLoyaltyPoints include ConvenientService::Standard::Config step CalculateDoubled, in: :number, out: {doubled: :points} private def number 21 end end result = AwardLoyaltyPoints.result result.success? # => true result.data[:points] # => 42in: :numbercallsnumberon the organizer (AwardLoyaltyPoints) and passes its return value asnumber:to the step (CalculateDoubled).Only a
Symbolis accepted - aString(e.g.in: "number") raisesUnsupportedKeyTypeexception.This is the default step input type - use it whenever the step's parameter name already matches an organizer method name. When the names differ, use a step alias input instead.
See also
- What step input types are available?
- What is a step alias input?
- What is a step raw input?
- What is a step proc input?
- What is a step?