@@ -63,16 +63,15 @@ public extension Module {
63
63
try __executeMethod ( method, withInputs: inputs. map { $0. asValue ( ) } )
64
64
}
65
65
66
- /// Executes a specific method with a single input value.
67
- /// The method is loaded on demand if not already loaded.
66
+ /// Executes a specific method with variadic inputs.
68
67
///
69
68
/// - Parameters:
70
69
/// - method: The name of the method to execute.
71
- /// - input : A single `ValueConvertible` type representing the input .
70
+ /// - inputs : A variadic list of `ValueConvertible` inputs .
72
71
/// - Returns: An array of `Value` objects representing the outputs.
73
- /// - Throws: An error if method execution fails.
74
- func execute( _ method: String , _ input : ValueConvertible ) throws -> [ Value ] {
75
- try __executeMethod ( method, withInputs : [ input . asValue ( ) ] )
72
+ /// - Throws: An error if loading or execution fails.
73
+ func execute( _ method: String , _ inputs : ValueConvertible ... ) throws -> [ Value ] {
74
+ try execute ( method, inputs )
76
75
}
77
76
78
77
/// Executes the "forward" method with the provided input values.
@@ -85,13 +84,12 @@ public extension Module {
85
84
try __executeMethod ( " forward " , withInputs: inputs. map { $0. asValue ( ) } )
86
85
}
87
86
88
- /// Executes the "forward" method with a single input value.
89
- /// The method is loaded on demand if not already loaded.
87
+ /// Executes the "forward" method with variadic inputs.
90
88
///
91
- /// - Parameter input : A single `ValueConvertible` type representing the input .
89
+ /// - Parameter inputs : A variadic list of `ValueConvertible` inputs .
92
90
/// - Returns: An array of `Value` objects representing the outputs.
93
- /// - Throws: An error if method execution fails.
94
- func forward( _ input : ValueConvertible ) throws -> [ Value ] {
95
- try __executeMethod ( " forward " , withInputs : [ input . asValue ( ) ] )
91
+ /// - Throws: An error if loading or execution fails.
92
+ func forward( _ inputs : ValueConvertible ... ) throws -> [ Value ] {
93
+ try forward ( inputs )
96
94
}
97
95
}
0 commit comments