Class: NewStoreApi::LimitExceededWhen

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

Overview

LimitExceededWhen 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(order_amount_lt = nil, shipment_count_gt = nil) ⇒ LimitExceededWhen

Returns a new instance of LimitExceededWhen.



38
39
40
41
# File 'lib/new_store_api/models/limit_exceeded_when.rb', line 38

def initialize(order_amount_lt = nil, shipment_count_gt = nil)
  @order_amount_lt = order_amount_lt
  @shipment_count_gt = shipment_count_gt
end

Instance Attribute Details

#order_amount_ltFloat

AND order amount less than

Returns:

  • (Float)


14
15
16
# File 'lib/new_store_api/models/limit_exceeded_when.rb', line 14

def order_amount_lt
  @order_amount_lt
end

#shipment_count_gtInteger

AAAAACondition: number of shipments greater than

Returns:

  • (Integer)


18
19
20
# File 'lib/new_store_api/models/limit_exceeded_when.rb', line 18

def shipment_count_gt
  @shipment_count_gt
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/new_store_api/models/limit_exceeded_when.rb', line 44

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  order_amount_lt =
    hash.key?('order_amount_lt') ? hash['order_amount_lt'] : nil
  shipment_count_gt =
    hash.key?('shipment_count_gt') ? hash['shipment_count_gt'] : nil

  # Create object from extracted values.
  LimitExceededWhen.new(order_amount_lt,
                        shipment_count_gt)
end

.namesObject

A mapping from model property names to API property names.



21
22
23
24
25
26
# File 'lib/new_store_api/models/limit_exceeded_when.rb', line 21

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

.nullablesObject

An array for nullable fields



34
35
36
# File 'lib/new_store_api/models/limit_exceeded_when.rb', line 34

def self.nullables
  []
end

.optionalsObject

An array for optional fields



29
30
31
# File 'lib/new_store_api/models/limit_exceeded_when.rb', line 29

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

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

#to_sObject

Provides a human-readable string representation of the object.



59
60
61
62
63
# File 'lib/new_store_api/models/limit_exceeded_when.rb', line 59

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