Class: NewStoreApi::LocalizedReasonCode
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::LocalizedReasonCode
- Defined in:
- lib/new_store_api/models/localized_reason_code.rb
Overview
LocalizedReasonCode Model.
Instance Attribute Summary collapse
-
#code ⇒ String
An identifier of the reason code, pattern is '^[^+=%]+$'.
-
#locale ⇒ String
The locale of the reason code, pattern is '(^[a-z]2-[A-Za-z]2$)'.
-
#name ⇒ String
The locale of the reason code, pattern is '(^[a-z]2-[A-Za-z]2$)'.
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(code = nil, locale = nil, name = nil) ⇒ LocalizedReasonCode
constructor
A new instance of LocalizedReasonCode.
-
#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(code = nil, locale = nil, name = nil) ⇒ LocalizedReasonCode
Returns a new instance of LocalizedReasonCode.
43 44 45 46 47 |
# File 'lib/new_store_api/models/localized_reason_code.rb', line 43 def initialize(code = nil, locale = nil, name = nil) @code = code @locale = locale @name = name end |
Instance Attribute Details
#code ⇒ String
An identifier of the reason code, pattern is '^[^+=%]+$'
14 15 16 |
# File 'lib/new_store_api/models/localized_reason_code.rb', line 14 def code @code end |
#locale ⇒ String
The locale of the reason code, pattern is '(^[a-z]2-[A-Za-z]2$)'
18 19 20 |
# File 'lib/new_store_api/models/localized_reason_code.rb', line 18 def locale @locale end |
#name ⇒ String
The locale of the reason code, pattern is '(^[a-z]2-[A-Za-z]2$)'
22 23 24 |
# File 'lib/new_store_api/models/localized_reason_code.rb', line 22 def name @name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/new_store_api/models/localized_reason_code.rb', line 50 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. code = hash.key?('code') ? hash['code'] : nil locale = hash.key?('locale') ? hash['locale'] : nil name = hash.key?('name') ? hash['name'] : nil # Create object from extracted values. LocalizedReasonCode.new(code, locale, name) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 |
# File 'lib/new_store_api/models/localized_reason_code.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['code'] = 'code' @_hash['locale'] = 'locale' @_hash['name'] = 'name' @_hash end |
.nullables ⇒ Object
An array for nullable fields
39 40 41 |
# File 'lib/new_store_api/models/localized_reason_code.rb', line 39 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 |
# File 'lib/new_store_api/models/localized_reason_code.rb', line 34 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
71 72 73 74 75 |
# File 'lib/new_store_api/models/localized_reason_code.rb', line 71 def inspect class_name = self.class.name.split('::').last "<#{class_name} code: #{@code.inspect}, locale: #{@locale.inspect}, name:"\ " #{@name.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
65 66 67 68 |
# File 'lib/new_store_api/models/localized_reason_code.rb', line 65 def to_s class_name = self.class.name.split('::').last "<#{class_name} code: #{@code}, locale: #{@locale}, name: #{@name}>" end |