Class: NewStoreApi::ExtendOrderSGracePeriodTimer

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

Overview

Response schema for the extend grace period timer includes the time when the grace period passes.

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(due_at = SKIP) ⇒ ExtendOrderSGracePeriodTimer

Returns a new instance of ExtendOrderSGracePeriodTimer.



37
38
39
# File 'lib/new_store_api/models/extend_order_s_grace_period_timer.rb', line 37

def initialize(due_at = SKIP)
  @due_at = due_at unless due_at == SKIP
end

Instance Attribute Details

#due_atDateTime

The time when the grace period passes or null if there is no grace period.

Returns:

  • (DateTime)


16
17
18
# File 'lib/new_store_api/models/extend_order_s_grace_period_timer.rb', line 16

def due_at
  @due_at
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/new_store_api/models/extend_order_s_grace_period_timer.rb', line 42

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  due_at = if hash.key?('due_at')
             (DateTimeHelper.from_rfc3339(hash['due_at']) if hash['due_at'])
           else
             SKIP
           end

  # Create object from extracted values.
  ExtendOrderSGracePeriodTimer.new(due_at)
end

.namesObject

A mapping from model property names to API property names.



19
20
21
22
23
# File 'lib/new_store_api/models/extend_order_s_grace_period_timer.rb', line 19

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

.nullablesObject

An array for nullable fields



33
34
35
# File 'lib/new_store_api/models/extend_order_s_grace_period_timer.rb', line 33

def self.nullables
  []
end

.optionalsObject

An array for optional fields



26
27
28
29
30
# File 'lib/new_store_api/models/extend_order_s_grace_period_timer.rb', line 26

def self.optionals
  %w[
    due_at
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

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

#to_custom_due_atObject



56
57
58
# File 'lib/new_store_api/models/extend_order_s_grace_period_timer.rb', line 56

def to_custom_due_at
  DateTimeHelper.to_rfc3339(due_at)
end

#to_sObject

Provides a human-readable string representation of the object.



61
62
63
64
# File 'lib/new_store_api/models/extend_order_s_grace_period_timer.rb', line 61

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