Module: CodinRep::InstanceMethods
- Defined in:
- lib/codin_rep.rb
Instance Method Summary collapse
- #get_employer ⇒ Object
- #get_records(first_id = nil) ⇒ Object
- #get_serial_number ⇒ Object
- #get_time ⇒ Object
- #set_employee(operation_type, registration, pis_number, name) ⇒ Object
- #set_time(time) ⇒ Object
Instance Method Details
#get_employer ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/codin_rep.rb', line 49 def get_employer command = CodinRep::GetAfdHeader.new(self.ip, self.tcp_port) response = command.execute hash = {} hash[:document_type] = response.employer_type hash[:document_number] = response.employer_document hash[:cei_document] = response.employer_cei hash[:company_name] = response.employer_name return hash end |
#get_records(first_id = nil) ⇒ Object
68 69 70 71 72 |
# File 'lib/codin_rep.rb', line 68 def get_records(first_id=nil) command = CodinRep::GetRecords.new(first_id, self.ip, self.tcp_port) response = command.execute response end |
#get_serial_number ⇒ Object
62 63 64 65 66 |
# File 'lib/codin_rep.rb', line 62 def get_serial_number command = CodinRep::GetAfdHeader.new(self.ip, self.tcp_port) response = command.execute response.rep_serial_number end |
#get_time ⇒ Object
37 38 39 40 41 |
# File 'lib/codin_rep.rb', line 37 def get_time command = CodinRep::GetTime.new(self.ip, self.tcp_port) response = command.execute return response end |
#set_employee(operation_type, registration, pis_number, name) ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/codin_rep.rb', line 74 def set_employee(operation_type, registration, pis_number, name) if [:add, :edit].include? operation_type command = CodinRep::AddEmployee.new(registration, pis_number, name, self.ip, self.tcp_port) elsif operation_type == :remove command = CodinRep::DelEmployee.new(registration, self.ip, self.tcp_port) else raise EmployeeCommand::UnknownEmployeeOperation.new(operation_type) end response = command.execute response end |