Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::Item3

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

Overview

Item3 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(product_name = nil, sku = nil, condition = nil, image_url = nil, weight = nil) ⇒ Item3

Returns a new instance of Item3.



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

def initialize(product_name = nil, sku = nil, condition = nil,
               image_url = nil, weight = nil)
  @product_name = product_name
  @sku = sku
  @condition = condition
  @image_url = image_url
  @weight = weight
end

Instance Attribute Details

#conditionString

TODO: Write general description for this method

Returns:

  • (String)


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

def condition
  @condition
end

#image_urlString

TODO: Write general description for this method

Returns:

  • (String)


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

def image_url
  @image_url
end

#product_nameString

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/item3.rb', line 15

def product_name
  @product_name
end

#skuString

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/item3.rb', line 19

def sku
  @sku
end

#weightWeight

TODO: Write general description for this method

Returns:



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

def weight
  @weight
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
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item3.rb', line 64

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  product_name = hash.key?('productName') ? hash['productName'] : nil
  sku = hash.key?('sku') ? hash['sku'] : nil
  condition = hash.key?('condition') ? hash['condition'] : nil
  image_url = hash.key?('imageUrl') ? hash['imageUrl'] : nil
  weight = Weight.from_hash(hash['weight']) if hash['weight']

  # Create object from extracted values.
  Item3.new(product_name,
            sku,
            condition,
            image_url,
            weight)
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/item3.rb', line 34

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['product_name'] = 'productName'
  @_hash['sku'] = 'sku'
  @_hash['condition'] = 'condition'
  @_hash['image_url'] = 'imageUrl'
  @_hash['weight'] = 'weight'
  @_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/item3.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/item3.rb', line 45

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



90
91
92
93
94
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item3.rb', line 90

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} product_name: #{@product_name.inspect}, sku: #{@sku.inspect}, condition:"\
  " #{@condition.inspect}, image_url: #{@image_url.inspect}, weight: #{@weight.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



83
84
85
86
87
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item3.rb', line 83

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} product_name: #{@product_name}, sku: #{@sku}, condition: #{@condition},"\
  " image_url: #{@image_url}, weight: #{@weight}>"
end