Class: CodinRep::AddEmployee

Inherits:
EmployeeCommand show all
Defined in:
lib/codin_rep/add_employee.rb

Constant Summary collapse

NAME_MAX_SIZE =
53
COMMAND_CODE =
"075h1".freeze
EXPECTED_HEADER =
"REP003h1".freeze
REGISTRATION_COMPLETED_HEADER =
'PGREP010h1'.freeze

Constants inherited from EmployeeCommand

EmployeeCommand::CODE_MAX_SIZE

Constants inherited from Command

Command::COMMAND_PREFIX

Instance Method Summary collapse

Methods inherited from EmployeeCommand

#check_response_header, #execute, #get_data_from_response_payload, #get_expected_response_size, #get_response_payload

Methods inherited from Command

#check_response_header, #execute, #generate_header, #get_data_from_response_payload, #get_expected_response_size, #get_max_attempts, #get_timeout_time, #should_close_connection?

Constructor Details

#initialize(registration, pis_number, name, *args) ⇒ AddEmployee

Returns a new instance of AddEmployee.



30
31
32
33
34
35
# File 'lib/codin_rep/add_employee.rb', line 30

def initialize(registration, pis_number, name, *args)
  super(*args)
  @registration = convert_integer_to_byte_string(registration)
  @pis_number = convert_integer_to_byte_string(pis_number)
  @name = convert_employee_name(name)
end

Instance Method Details

#generate_command_payloadObject



37
38
39
# File 'lib/codin_rep/add_employee.rb', line 37

def generate_command_payload
  "#{@registration}#{@pis_number}#{@name}"
end