Class: NewStoreApi::CancellationPolicySettings
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::CancellationPolicySettings
- Defined in:
- lib/new_store_api/models/cancellation_policy_settings.rb
Overview
CancellationPolicySettings Model.
Instance Attribute Summary collapse
-
#updated_at ⇒ DateTime
TODO: Write general description for this method.
-
#value ⇒ CancellationPolicySettingsValue
Order cancellation policies.
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(value = nil, updated_at = SKIP) ⇒ CancellationPolicySettings
constructor
A new instance of CancellationPolicySettings.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_updated_at ⇒ Object
-
#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(value = nil, updated_at = SKIP) ⇒ CancellationPolicySettings
Returns a new instance of CancellationPolicySettings.
44 45 46 47 |
# File 'lib/new_store_api/models/cancellation_policy_settings.rb', line 44 def initialize(value = nil, updated_at = SKIP) @updated_at = updated_at unless updated_at == SKIP @value = value end |
Instance Attribute Details
#updated_at ⇒ DateTime
TODO: Write general description for this method
15 16 17 |
# File 'lib/new_store_api/models/cancellation_policy_settings.rb', line 15 def updated_at @updated_at end |
#value ⇒ CancellationPolicySettingsValue
Order cancellation policies.
19 20 21 |
# File 'lib/new_store_api/models/cancellation_policy_settings.rb', line 19 def value @value 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 63 64 |
# File 'lib/new_store_api/models/cancellation_policy_settings.rb', line 50 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. value = CancellationPolicySettingsValue.from_hash(hash['value']) if hash['value'] updated_at = if hash.key?('updated_at') (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at']) else SKIP end # Create object from extracted values. CancellationPolicySettings.new(value, updated_at) end |
.names ⇒ Object
A mapping from model property names to API property names.
22 23 24 25 26 27 |
# File 'lib/new_store_api/models/cancellation_policy_settings.rb', line 22 def self.names @_hash = {} if @_hash.nil? @_hash['updated_at'] = 'updated_at' @_hash['value'] = 'value' @_hash end |
.nullables ⇒ Object
An array for nullable fields
37 38 39 40 41 42 |
# File 'lib/new_store_api/models/cancellation_policy_settings.rb', line 37 def self.nullables %w[ updated_at value ] end |
.optionals ⇒ Object
An array for optional fields
30 31 32 33 34 |
# File 'lib/new_store_api/models/cancellation_policy_settings.rb', line 30 def self.optionals %w[ updated_at ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
77 78 79 80 |
# File 'lib/new_store_api/models/cancellation_policy_settings.rb', line 77 def inspect class_name = self.class.name.split('::').last "<#{class_name} updated_at: #{@updated_at.inspect}, value: #{@value.inspect}>" end |
#to_custom_updated_at ⇒ Object
66 67 68 |
# File 'lib/new_store_api/models/cancellation_policy_settings.rb', line 66 def to_custom_updated_at DateTimeHelper.to_rfc3339(updated_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
71 72 73 74 |
# File 'lib/new_store_api/models/cancellation_policy_settings.rb', line 71 def to_s class_name = self.class.name.split('::').last "<#{class_name} updated_at: #{@updated_at}, value: #{@value}>" end |