Module: Inferno::DSL::InputOutputHandling
- Defined in:
- lib/inferno/dsl/input_output_handling.rb
Instance Method Summary collapse
-
#input(identifier, *other_identifiers, **input_params) ⇒ void
Define inputs.
-
#input_order(*new_input_order) ⇒ Array<String, Symbol>
Define a particular order for inputs to be presented in the API/UI.
-
#output(identifier, *other_identifiers, **output_definition) ⇒ void
Define outputs.
Instance Method Details
#input(identifier, *other_identifiers, **input_params) ⇒ void
This method returns an undefined value.
Define inputs
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/inferno/dsl/input_output_handling.rb', line 24 def input(identifier, *other_identifiers, **input_params) if other_identifiers.present? [identifier, *other_identifiers].compact.each do |input_identifier| inputs << input_identifier config.add_input(input_identifier) children .reject { |child| child.inputs.include? input_identifier } .each do |child| child.input(input_identifier) end end else inputs << identifier config.add_input(identifier, input_params) children .reject { |child| child.inputs.include? identifier } .each do |child| child.input(identifier, **input_params) end end end |
#input_order(*new_input_order) ⇒ Array<String, Symbol>
Define a particular order for inputs to be presented in the API/UI
116 117 118 119 120 |
# File 'lib/inferno/dsl/input_output_handling.rb', line 116 def input_order(*new_input_order) return @input_order = new_input_order if new_input_order.present? @input_order ||= [] end |
#output(identifier, *other_identifiers, **output_definition) ⇒ void
This method returns an undefined value.
Define outputs
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/inferno/dsl/input_output_handling.rb', line 57 def output(identifier, *other_identifiers, **output_definition) if other_identifiers.present? [identifier, *other_identifiers].compact.each do |output_identifier| outputs << output_identifier config.add_output(output_identifier) children .reject { |child| child.outputs.include? output_identifier } .each do |child| child.output(output_identifier) end end else outputs << identifier config.add_output(identifier, output_definition) children .reject { |child| child.outputs.include? identifier } .each do |child| child.output(identifier, **output_definition) end end end |