Class: NewStoreApi::FiscalReceiptResultV1Dto
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::FiscalReceiptResultV1Dto
- Defined in:
- lib/new_store_api/models/fiscal_receipt_result_v1_dto.rb
Overview
FiscalReceiptResultV1Dto Model.
Instance Attribute Summary collapse
-
#fiscal_receipt_amount ⇒ Float
Fiscal receipt amount from the fiscal printer.
-
#fiscal_receipt_number ⇒ Integer
Fiscal receipt number under the current Z-report number from the fiscal printer.
-
#fiscal_receipt_timestamp ⇒ String
Fiscal receipt ISO timestamp from the fiscal printer.
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(fiscal_receipt_amount = SKIP, fiscal_receipt_number = SKIP, fiscal_receipt_timestamp = SKIP) ⇒ FiscalReceiptResultV1Dto
constructor
A new instance of FiscalReceiptResultV1Dto.
-
#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(fiscal_receipt_amount = SKIP, fiscal_receipt_number = SKIP, fiscal_receipt_timestamp = SKIP) ⇒ FiscalReceiptResultV1Dto
Returns a new instance of FiscalReceiptResultV1Dto.
48 49 50 51 52 53 |
# File 'lib/new_store_api/models/fiscal_receipt_result_v1_dto.rb', line 48 def initialize(fiscal_receipt_amount = SKIP, fiscal_receipt_number = SKIP, = SKIP) @fiscal_receipt_amount = fiscal_receipt_amount unless fiscal_receipt_amount == SKIP @fiscal_receipt_number = fiscal_receipt_number unless fiscal_receipt_number == SKIP @fiscal_receipt_timestamp = unless == SKIP end |
Instance Attribute Details
#fiscal_receipt_amount ⇒ Float
Fiscal receipt amount from the fiscal printer.
14 15 16 |
# File 'lib/new_store_api/models/fiscal_receipt_result_v1_dto.rb', line 14 def fiscal_receipt_amount @fiscal_receipt_amount end |
#fiscal_receipt_number ⇒ Integer
Fiscal receipt number under the current Z-report number from the fiscal printer.
19 20 21 |
# File 'lib/new_store_api/models/fiscal_receipt_result_v1_dto.rb', line 19 def fiscal_receipt_number @fiscal_receipt_number end |
#fiscal_receipt_timestamp ⇒ String
Fiscal receipt ISO timestamp from the fiscal printer.
23 24 25 |
# File 'lib/new_store_api/models/fiscal_receipt_result_v1_dto.rb', line 23 def @fiscal_receipt_timestamp end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/new_store_api/models/fiscal_receipt_result_v1_dto.rb', line 56 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. fiscal_receipt_amount = hash.key?('fiscal_receipt_amount') ? hash['fiscal_receipt_amount'] : SKIP fiscal_receipt_number = hash.key?('fiscal_receipt_number') ? hash['fiscal_receipt_number'] : SKIP = hash.key?('fiscal_receipt_timestamp') ? hash['fiscal_receipt_timestamp'] : SKIP # Create object from extracted values. FiscalReceiptResultV1Dto.new(fiscal_receipt_amount, fiscal_receipt_number, ) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 32 |
# File 'lib/new_store_api/models/fiscal_receipt_result_v1_dto.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['fiscal_receipt_amount'] = 'fiscal_receipt_amount' @_hash['fiscal_receipt_number'] = 'fiscal_receipt_number' @_hash['fiscal_receipt_timestamp'] = 'fiscal_receipt_timestamp' @_hash end |
.nullables ⇒ Object
An array for nullable fields
44 45 46 |
# File 'lib/new_store_api/models/fiscal_receipt_result_v1_dto.rb', line 44 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
35 36 37 38 39 40 41 |
# File 'lib/new_store_api/models/fiscal_receipt_result_v1_dto.rb', line 35 def self.optionals %w[ fiscal_receipt_amount fiscal_receipt_number fiscal_receipt_timestamp ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
75 76 77 78 79 80 81 |
# File 'lib/new_store_api/models/fiscal_receipt_result_v1_dto.rb', line 75 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
91 92 93 94 95 96 |
# File 'lib/new_store_api/models/fiscal_receipt_result_v1_dto.rb', line 91 def inspect class_name = self.class.name.split('::').last "<#{class_name} fiscal_receipt_amount: #{@fiscal_receipt_amount.inspect},"\ " fiscal_receipt_number: #{@fiscal_receipt_number.inspect}, fiscal_receipt_timestamp:"\ " #{@fiscal_receipt_timestamp.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
84 85 86 87 88 |
# File 'lib/new_store_api/models/fiscal_receipt_result_v1_dto.rb', line 84 def to_s class_name = self.class.name.split('::').last "<#{class_name} fiscal_receipt_amount: #{@fiscal_receipt_amount}, fiscal_receipt_number:"\ " #{@fiscal_receipt_number}, fiscal_receipt_timestamp: #{@fiscal_receipt_timestamp}>" end |