Class: NewStoreApi::StoreCreateV1Dto
- Defined in:
- lib/new_store_api/models/store_create_v1_dto.rb
Overview
StoreCreateV1Dto Model.
Instance Attribute Summary collapse
-
#config ⇒ StoreConfigV1Dto
Store configuration.
-
#country_code ⇒ String
Store configuration.
-
#description ⇒ String
Store name/description.
-
#id ⇒ String
Store identifier.
-
#multi_cashbox ⇒ TrueClass | FalseClass
Flag that indicates if multiple cashboxes are allowed in the store.
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.
Instance Method Summary collapse
-
#initialize(config = nil, country_code = nil, id = nil, multi_cashbox = nil, description = SKIP) ⇒ StoreCreateV1Dto
constructor
A new instance of StoreCreateV1Dto.
-
#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(config = nil, country_code = nil, id = nil, multi_cashbox = nil, description = SKIP) ⇒ StoreCreateV1Dto
Returns a new instance of StoreCreateV1Dto.
55 56 57 58 59 60 61 62 |
# File 'lib/new_store_api/models/store_create_v1_dto.rb', line 55 def initialize(config = nil, country_code = nil, id = nil, multi_cashbox = nil, description = SKIP) @config = config @country_code = country_code @description = description unless description == SKIP @id = id @multi_cashbox = multi_cashbox end |
Instance Attribute Details
#config ⇒ StoreConfigV1Dto
Store configuration.
14 15 16 |
# File 'lib/new_store_api/models/store_create_v1_dto.rb', line 14 def config @config end |
#country_code ⇒ String
Store configuration.
18 19 20 |
# File 'lib/new_store_api/models/store_create_v1_dto.rb', line 18 def country_code @country_code end |
#description ⇒ String
Store name/description.
22 23 24 |
# File 'lib/new_store_api/models/store_create_v1_dto.rb', line 22 def description @description end |
#id ⇒ String
Store identifier.
26 27 28 |
# File 'lib/new_store_api/models/store_create_v1_dto.rb', line 26 def id @id end |
#multi_cashbox ⇒ TrueClass | FalseClass
Flag that indicates if multiple cashboxes are allowed in the store.
30 31 32 |
# File 'lib/new_store_api/models/store_create_v1_dto.rb', line 30 def multi_cashbox @multi_cashbox end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/new_store_api/models/store_create_v1_dto.rb', line 65 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. config = StoreConfigV1Dto.from_hash(hash['config']) if hash['config'] country_code = hash.key?('country_code') ? hash['country_code'] : nil id = hash.key?('id') ? hash['id'] : nil multi_cashbox = hash.key?('multi_cashbox') ? hash['multi_cashbox'] : nil description = hash.key?('description') ? hash['description'] : SKIP # Create object from extracted values. StoreCreateV1Dto.new(config, country_code, id, multi_cashbox, description) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/new_store_api/models/store_create_v1_dto.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['config'] = 'config' @_hash['country_code'] = 'country_code' @_hash['description'] = 'description' @_hash['id'] = 'id' @_hash['multi_cashbox'] = 'multi_cashbox' @_hash end |
.nullables ⇒ Object
An array for nullable fields
51 52 53 |
# File 'lib/new_store_api/models/store_create_v1_dto.rb', line 51 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 |
# File 'lib/new_store_api/models/store_create_v1_dto.rb', line 44 def self.optionals %w[ description ] 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/store_create_v1_dto.rb', line 91 def inspect class_name = self.class.name.split('::').last "<#{class_name} config: #{@config.inspect}, country_code: #{@country_code.inspect},"\ " description: #{@description.inspect}, id: #{@id.inspect}, multi_cashbox:"\ " #{@multi_cashbox.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/store_create_v1_dto.rb', line 84 def to_s class_name = self.class.name.split('::').last "<#{class_name} config: #{@config}, country_code: #{@country_code}, description:"\ " #{@description}, id: #{@id}, multi_cashbox: #{@multi_cashbox}>" end |