Class: NewStoreApi::AutomaticReroutingSettings

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/new_store_api/models/automatic_rerouting_settings.rb

Overview

AutomaticReroutingSettings Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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) ⇒ AutomaticReroutingSettings

Returns a new instance of AutomaticReroutingSettings.



45
46
47
48
# File 'lib/new_store_api/models/automatic_rerouting_settings.rb', line 45

def initialize(value = nil, updated_at = SKIP)
  @updated_at = updated_at unless updated_at == SKIP
  @value = value
end

Instance Attribute Details

#updated_atDateTime

TODO: Write general description for this method

Returns:

  • (DateTime)


15
16
17
# File 'lib/new_store_api/models/automatic_rerouting_settings.rb', line 15

def updated_at
  @updated_at
end

#valueTrueClass | FalseClass

Tenant-based release toggle for the automatic rerouting feature in order to roll it out on a per tenant basis.

Returns:

  • (TrueClass | FalseClass)


20
21
22
# File 'lib/new_store_api/models/automatic_rerouting_settings.rb', line 20

def value
  @value
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/new_store_api/models/automatic_rerouting_settings.rb', line 51

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  value = hash.key?('value') ? hash['value'] : nil
  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.
  AutomaticReroutingSettings.new(value,
                                 updated_at)
end

.namesObject

A mapping from model property names to API property names.



23
24
25
26
27
28
# File 'lib/new_store_api/models/automatic_rerouting_settings.rb', line 23

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['updated_at'] = 'updated_at'
  @_hash['value'] = 'value'
  @_hash
end

.nullablesObject

An array for nullable fields



38
39
40
41
42
43
# File 'lib/new_store_api/models/automatic_rerouting_settings.rb', line 38

def self.nullables
  %w[
    updated_at
    value
  ]
end

.optionalsObject

An array for optional fields



31
32
33
34
35
# File 'lib/new_store_api/models/automatic_rerouting_settings.rb', line 31

def self.optionals
  %w[
    updated_at
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



78
79
80
81
# File 'lib/new_store_api/models/automatic_rerouting_settings.rb', line 78

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} updated_at: #{@updated_at.inspect}, value: #{@value.inspect}>"
end

#to_custom_updated_atObject



67
68
69
# File 'lib/new_store_api/models/automatic_rerouting_settings.rb', line 67

def to_custom_updated_at
  DateTimeHelper.to_rfc3339(updated_at)
end

#to_sObject

Provides a human-readable string representation of the object.



72
73
74
75
# File 'lib/new_store_api/models/automatic_rerouting_settings.rb', line 72

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} updated_at: #{@updated_at}, value: #{@value}>"
end