Class: Inferno::Utils::PresetProcessor Private

Inherits:
Object
  • Object
show all
Defined in:
lib/inferno/utils/preset_processor.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

This class determines which values to use in a preset based on the suite options chosen in a session.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(preset, session) ⇒ PresetProcessor

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of PresetProcessor.



9
10
11
12
13
14
15
# File 'lib/inferno/utils/preset_processor.rb', line 9

def initialize(preset, session)
  self.preset = preset
  self.session = session
  self.suite = session.test_suite
  self.suite_inputs = suite.available_inputs.transform_values(&:to_hash)
  self.suite_options = session.suite_options
end

Instance Attribute Details

#presetObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7
8
9
# File 'lib/inferno/utils/preset_processor.rb', line 7

def preset
  @preset
end

#sessionObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7
8
9
# File 'lib/inferno/utils/preset_processor.rb', line 7

def session
  @session
end

#suiteObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7
8
9
# File 'lib/inferno/utils/preset_processor.rb', line 7

def suite
  @suite
end

#suite_inputsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7
8
9
# File 'lib/inferno/utils/preset_processor.rb', line 7

def suite_inputs
  @suite_inputs
end

#suite_optionsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7
8
9
# File 'lib/inferno/utils/preset_processor.rb', line 7

def suite_options
  @suite_options
end

Instance Method Details

#processed_inputsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the list of inputs which need to be persisted, with options applied.



19
20
21
22
23
# File 'lib/inferno/utils/preset_processor.rb', line 19

def processed_inputs
  preset.inputs
    .map { |input| input_for_options(input) }
    .compact
end