Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::DestinationItem1

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

Overview

DestinationItem1 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(mart = nil, wpid = nil, gtin = nil, upc = nil, item_id = nil, product_name = nil, product_type = nil) ⇒ DestinationItem1

Returns a new instance of DestinationItem1.



64
65
66
67
68
69
70
71
72
73
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item1.rb', line 64

def initialize(mart = nil, wpid = nil, gtin = nil, upc = nil, item_id = nil,
               product_name = nil, product_type = nil)
  @mart = mart
  @wpid = wpid
  @gtin = gtin
  @upc = upc
  @item_id = item_id
  @product_name = product_name
  @product_type = product_type
end

Instance Attribute Details

#gtinString

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/destination_item1.rb', line 23

def gtin
  @gtin
end

#item_idString

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/destination_item1.rb', line 31

def item_id
  @item_id
end

#martString

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

def mart
  @mart
end

#product_nameString

TODO: Write general description for this method

Returns:

  • (String)


35
36
37
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item1.rb', line 35

def product_name
  @product_name
end

#product_typeString

TODO: Write general description for this method

Returns:

  • (String)


39
40
41
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item1.rb', line 39

def product_type
  @product_type
end

#upcString

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/destination_item1.rb', line 27

def upc
  @upc
end

#wpidString

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

def wpid
  @wpid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item1.rb', line 76

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  mart = hash.key?('mart') ? hash['mart'] : nil
  wpid = hash.key?('wpid') ? hash['wpid'] : nil
  gtin = hash.key?('gtin') ? hash['gtin'] : nil
  upc = hash.key?('upc') ? hash['upc'] : nil
  item_id = hash.key?('itemId') ? hash['itemId'] : nil
  product_name = hash.key?('productName') ? hash['productName'] : nil
  product_type = hash.key?('productType') ? hash['productType'] : nil

  # Create object from extracted values.
  DestinationItem1.new(mart,
                       wpid,
                       gtin,
                       upc,
                       item_id,
                       product_name,
                       product_type)
end

.namesObject

A mapping from model property names to API property names.



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item1.rb', line 42

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['mart'] = 'mart'
  @_hash['wpid'] = 'wpid'
  @_hash['gtin'] = 'gtin'
  @_hash['upc'] = 'upc'
  @_hash['item_id'] = 'itemId'
  @_hash['product_name'] = 'productName'
  @_hash['product_type'] = 'productType'
  @_hash
end

.nullablesObject

An array for nullable fields



60
61
62
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item1.rb', line 60

def self.nullables
  []
end

.optionalsObject

An array for optional fields



55
56
57
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item1.rb', line 55

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



106
107
108
109
110
111
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item1.rb', line 106

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} mart: #{@mart.inspect}, wpid: #{@wpid.inspect}, gtin: #{@gtin.inspect},"\
  " upc: #{@upc.inspect}, item_id: #{@item_id.inspect}, product_name:"\
  " #{@product_name.inspect}, product_type: #{@product_type.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



99
100
101
102
103
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item1.rb', line 99

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} mart: #{@mart}, wpid: #{@wpid}, gtin: #{@gtin}, upc: #{@upc}, item_id:"\
  " #{@item_id}, product_name: #{@product_name}, product_type: #{@product_type}>"
end