Class: NewStoreApi::SignatureSeV1Dto
- Defined in:
- lib/new_store_api/models/signature_se_v1_dto.rb
Overview
SignatureSeV1Dto Model.
Instance Attribute Summary collapse
-
#cash_register_name ⇒ String
Cash register name used with Axena.
-
#control_unit_response ⇒ String
Control unit response.
-
#control_unit_serial ⇒ String
Control unit serial.
-
#environment ⇒ FiscalEnvironmentEnum
Control unit serial.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(cash_register_name = nil, control_unit_response = nil, control_unit_serial = nil, environment = nil) ⇒ SignatureSeV1Dto
constructor
A new instance of SignatureSeV1Dto.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(cash_register_name = nil, control_unit_response = nil, control_unit_serial = nil, environment = nil) ⇒ SignatureSeV1Dto
Returns a new instance of SignatureSeV1Dto.
48 49 50 51 52 53 54 |
# File 'lib/new_store_api/models/signature_se_v1_dto.rb', line 48 def initialize(cash_register_name = nil, control_unit_response = nil, control_unit_serial = nil, environment = nil) @cash_register_name = cash_register_name @control_unit_response = control_unit_response @control_unit_serial = control_unit_serial @environment = environment end |
Instance Attribute Details
#cash_register_name ⇒ String
Cash register name used with Axena.
14 15 16 |
# File 'lib/new_store_api/models/signature_se_v1_dto.rb', line 14 def cash_register_name @cash_register_name end |
#control_unit_response ⇒ String
Control unit response.
18 19 20 |
# File 'lib/new_store_api/models/signature_se_v1_dto.rb', line 18 def control_unit_response @control_unit_response end |
#control_unit_serial ⇒ String
Control unit serial
22 23 24 |
# File 'lib/new_store_api/models/signature_se_v1_dto.rb', line 22 def control_unit_serial @control_unit_serial end |
#environment ⇒ FiscalEnvironmentEnum
Control unit serial
26 27 28 |
# File 'lib/new_store_api/models/signature_se_v1_dto.rb', line 26 def environment @environment end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/new_store_api/models/signature_se_v1_dto.rb', line 57 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. cash_register_name = hash.key?('cash_register_name') ? hash['cash_register_name'] : nil control_unit_response = hash.key?('control_unit_response') ? hash['control_unit_response'] : nil control_unit_serial = hash.key?('control_unit_serial') ? hash['control_unit_serial'] : nil environment = hash.key?('environment') ? hash['environment'] : nil # Create object from extracted values. SignatureSeV1Dto.new(cash_register_name, control_unit_response, control_unit_serial, environment) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/new_store_api/models/signature_se_v1_dto.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['cash_register_name'] = 'cash_register_name' @_hash['control_unit_response'] = 'control_unit_response' @_hash['control_unit_serial'] = 'control_unit_serial' @_hash['environment'] = 'environment' @_hash end |
.nullables ⇒ Object
An array for nullable fields
44 45 46 |
# File 'lib/new_store_api/models/signature_se_v1_dto.rb', line 44 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 |
# File 'lib/new_store_api/models/signature_se_v1_dto.rb', line 39 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/new_store_api/models/signature_se_v1_dto.rb', line 78 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.cash_register_name, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.control_unit_response, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.control_unit_serial, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.environment, ->(val) { FiscalEnvironmentEnum.validate(val) }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['cash_register_name'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['control_unit_response'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['control_unit_serial'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['environment'], ->(val) { FiscalEnvironmentEnum.validate(val) }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
115 116 117 118 119 120 |
# File 'lib/new_store_api/models/signature_se_v1_dto.rb', line 115 def inspect class_name = self.class.name.split('::').last "<#{class_name} cash_register_name: #{@cash_register_name.inspect}, control_unit_response:"\ " #{@control_unit_response.inspect}, control_unit_serial: #{@control_unit_serial.inspect},"\ " environment: #{@environment.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
107 108 109 110 111 112 |
# File 'lib/new_store_api/models/signature_se_v1_dto.rb', line 107 def to_s class_name = self.class.name.split('::').last "<#{class_name} cash_register_name: #{@cash_register_name}, control_unit_response:"\ " #{@control_unit_response}, control_unit_serial: #{@control_unit_serial}, environment:"\ " #{@environment}>" end |