Class: Parameter::ParameterHandler

Inherits:
RubyUtils::Parameter::BaseParameterHandler
  • Object
show all
Defined in:
lib/parameter/parameter_handler.rb

Overview

class to seperate the storage of the parameter in a repository entity and checking for valid parameter combination as part of the application logic.

Instance Method Summary collapse

Instance Method Details

#check_parameter_constraintsObject (private)

private method to the specified parameter constraints



22
23
24
25
26
27
28
29
30
# File 'lib/parameter/parameter_handler.rb', line 22

def check_parameter_constraints
  # check mandatory file parameter
  check_mandatory_parameter(:file)

  # check mandatory mode parameter
  if (!@repository.parameters[:mode])
    @repository.parameters[:mode] = :http_status
  end
end

#initialize_repository(argv) ⇒ Object

method to initialize the correct repository that should be used in this handler

Parameters:

  • argv (Array)

    array of input parameters



10
11
12
# File 'lib/parameter/parameter_handler.rb', line 10

def initialize_repository(argv)
  @repository = Parameter::ParameterRepository.new(argv)
end

#validate_parametersObject (private)

private method with calls of the different validations methods



17
18
19
# File 'lib/parameter/parameter_handler.rb', line 17

def validate_parameters
  nil
end