Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::Properties1

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/inventory_management_and_item_management_and_order_management_and_price_management/models/properties1.rb

Overview

Properties1 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(variant_items_num = nil, num_reviews = nil, categories = nil, variants = nil, next_day_eligible = nil) ⇒ Properties1

Returns a new instance of Properties1.



54
55
56
57
58
59
60
61
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/properties1.rb', line 54

def initialize(variant_items_num = nil, num_reviews = nil, categories = nil,
               variants = nil, next_day_eligible = nil)
  @variant_items_num = variant_items_num
  @num_reviews = num_reviews
  @categories = categories
  @variants = variants
  @next_day_eligible = next_day_eligible
end

Instance Attribute Details

#categoriesArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


23
24
25
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/properties1.rb', line 23

def categories
  @categories
end

#next_day_eligibleString

TODO: Write general description for this method

Returns:

  • (String)


31
32
33
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/properties1.rb', line 31

def next_day_eligible
  @next_day_eligible
end

#num_reviewsString

TODO: Write general description for this method

Returns:

  • (String)


19
20
21
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/properties1.rb', line 19

def num_reviews
  @num_reviews
end

#variant_items_numString

TODO: Write general description for this method

Returns:

  • (String)


15
16
17
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/properties1.rb', line 15

def variant_items_num
  @variant_items_num
end

#variantsVariants

TODO: Write general description for this method

Returns:



27
28
29
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/properties1.rb', line 27

def variants
  @variants
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/properties1.rb', line 64

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  variant_items_num =
    hash.key?('variant_items_num') ? hash['variant_items_num'] : nil
  num_reviews = hash.key?('num_reviews') ? hash['num_reviews'] : nil
  categories = hash.key?('categories') ? hash['categories'] : nil
  variants = Variants.from_hash(hash['variants']) if hash['variants']
  next_day_eligible =
    hash.key?('next_day_eligible') ? hash['next_day_eligible'] : nil

  # Create object from extracted values.
  Properties1.new(variant_items_num,
                  num_reviews,
                  categories,
                  variants,
                  next_day_eligible)
end

.namesObject

A mapping from model property names to API property names.



34
35
36
37
38
39
40
41
42
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/properties1.rb', line 34

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['variant_items_num'] = 'variant_items_num'
  @_hash['num_reviews'] = 'num_reviews'
  @_hash['categories'] = 'categories'
  @_hash['variants'] = 'variants'
  @_hash['next_day_eligible'] = 'next_day_eligible'
  @_hash
end

.nullablesObject

An array for nullable fields



50
51
52
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/properties1.rb', line 50

def self.nullables
  []
end

.optionalsObject

An array for optional fields



45
46
47
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/properties1.rb', line 45

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



93
94
95
96
97
98
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/properties1.rb', line 93

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} variant_items_num: #{@variant_items_num.inspect}, num_reviews:"\
  " #{@num_reviews.inspect}, categories: #{@categories.inspect}, variants:"\
  " #{@variants.inspect}, next_day_eligible: #{@next_day_eligible.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



85
86
87
88
89
90
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/properties1.rb', line 85

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} variant_items_num: #{@variant_items_num}, num_reviews: #{@num_reviews},"\
  " categories: #{@categories}, variants: #{@variants}, next_day_eligible:"\
  " #{@next_day_eligible}>"
end