Class: NewStoreApi::SignaturePrV1Dto
- Defined in:
- lib/new_store_api/models/signature_pr_v1_dto.rb
Overview
SignaturePrV1Dto Model.
Instance Attribute Summary collapse
-
#control_number ⇒ String
Control number recieved from YCS.
-
#environment ⇒ FiscalEnvironmentEnum
Control number recieved from YCS.
-
#pos_id ⇒ Integer
YCS POS Identifier.
-
#processor ⇒ String
The processor of the transaction.
-
#processor_message ⇒ String
Footer message of the processor.
-
#signing_required ⇒ TrueClass | FalseClass
Flag that states whether transaction requires signing through YCS.
-
#transaction_id ⇒ String
Identifier of the transaction.
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(control_number = nil, environment = nil, pos_id = nil, processor = nil, processor_message = nil, signing_required = nil, transaction_id = nil) ⇒ SignaturePrV1Dto
constructor
A new instance of SignaturePrV1Dto.
-
#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(control_number = nil, environment = nil, pos_id = nil, processor = nil, processor_message = nil, signing_required = nil, transaction_id = nil) ⇒ SignaturePrV1Dto
Returns a new instance of SignaturePrV1Dto.
63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/new_store_api/models/signature_pr_v1_dto.rb', line 63 def initialize(control_number = nil, environment = nil, pos_id = nil, processor = nil, = nil, signing_required = nil, transaction_id = nil) @control_number = control_number @environment = environment @pos_id = pos_id @processor = processor @processor_message = @signing_required = signing_required @transaction_id = transaction_id end |
Instance Attribute Details
#control_number ⇒ String
Control number recieved from YCS.
14 15 16 |
# File 'lib/new_store_api/models/signature_pr_v1_dto.rb', line 14 def control_number @control_number end |
#environment ⇒ FiscalEnvironmentEnum
Control number recieved from YCS.
18 19 20 |
# File 'lib/new_store_api/models/signature_pr_v1_dto.rb', line 18 def environment @environment end |
#pos_id ⇒ Integer
YCS POS Identifier.
22 23 24 |
# File 'lib/new_store_api/models/signature_pr_v1_dto.rb', line 22 def pos_id @pos_id end |
#processor ⇒ String
The processor of the transaction.
26 27 28 |
# File 'lib/new_store_api/models/signature_pr_v1_dto.rb', line 26 def processor @processor end |
#processor_message ⇒ String
Footer message of the processor.
30 31 32 |
# File 'lib/new_store_api/models/signature_pr_v1_dto.rb', line 30 def @processor_message end |
#signing_required ⇒ TrueClass | FalseClass
Flag that states whether transaction requires signing through YCS.
34 35 36 |
# File 'lib/new_store_api/models/signature_pr_v1_dto.rb', line 34 def signing_required @signing_required end |
#transaction_id ⇒ String
Identifier of the transaction.
38 39 40 |
# File 'lib/new_store_api/models/signature_pr_v1_dto.rb', line 38 def transaction_id @transaction_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/new_store_api/models/signature_pr_v1_dto.rb', line 76 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. control_number = hash.key?('control_number') ? hash['control_number'] : nil environment = hash.key?('environment') ? hash['environment'] : nil pos_id = hash.key?('pos_id') ? hash['pos_id'] : nil processor = hash.key?('processor') ? hash['processor'] : nil = hash.key?('processor_message') ? hash['processor_message'] : nil signing_required = hash.key?('signing_required') ? hash['signing_required'] : nil transaction_id = hash.key?('transaction_id') ? hash['transaction_id'] : nil # Create object from extracted values. SignaturePrV1Dto.new(control_number, environment, pos_id, processor, , signing_required, transaction_id) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/new_store_api/models/signature_pr_v1_dto.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['control_number'] = 'control_number' @_hash['environment'] = 'environment' @_hash['pos_id'] = 'pos_id' @_hash['processor'] = 'processor' @_hash['processor_message'] = 'processor_message' @_hash['signing_required'] = 'signing_required' @_hash['transaction_id'] = 'transaction_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
59 60 61 |
# File 'lib/new_store_api/models/signature_pr_v1_dto.rb', line 59 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 |
# File 'lib/new_store_api/models/signature_pr_v1_dto.rb', line 54 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/new_store_api/models/signature_pr_v1_dto.rb', line 104 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.control_number, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.environment, ->(val) { FiscalEnvironmentEnum.validate(val) }) and APIHelper.valid_type?(value.pos_id, ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value.processor, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value., ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.signing_required, ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and APIHelper.valid_type?(value.transaction_id, ->(val) { val.instance_of? String }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['control_number'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['environment'], ->(val) { FiscalEnvironmentEnum.validate(val) }) and APIHelper.valid_type?(value['pos_id'], ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value['processor'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['processor_message'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['signing_required'], ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and APIHelper.valid_type?(value['transaction_id'], ->(val) { val.instance_of? String }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
153 154 155 156 157 158 159 |
# File 'lib/new_store_api/models/signature_pr_v1_dto.rb', line 153 def inspect class_name = self.class.name.split('::').last "<#{class_name} control_number: #{@control_number.inspect}, environment:"\ " #{@environment.inspect}, pos_id: #{@pos_id.inspect}, processor: #{@processor.inspect},"\ " processor_message: #{@processor_message.inspect}, signing_required:"\ " #{@signing_required.inspect}, transaction_id: #{@transaction_id.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
145 146 147 148 149 150 |
# File 'lib/new_store_api/models/signature_pr_v1_dto.rb', line 145 def to_s class_name = self.class.name.split('::').last "<#{class_name} control_number: #{@control_number}, environment: #{@environment}, pos_id:"\ " #{@pos_id}, processor: #{@processor}, processor_message: #{@processor_message},"\ " signing_required: #{@signing_required}, transaction_id: #{@transaction_id}>" end |