Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::Item3
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::Item3
- Defined in:
- lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item3.rb
Overview
Item3 Model.
Instance Attribute Summary collapse
-
#condition ⇒ String
TODO: Write general description for this method.
-
#image_url ⇒ String
TODO: Write general description for this method.
-
#product_name ⇒ String
TODO: Write general description for this method.
-
#sku ⇒ String
TODO: Write general description for this method.
-
#weight ⇒ Weight
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(product_name = nil, sku = nil, condition = nil, image_url = nil, weight = nil) ⇒ Item3
constructor
A new instance of Item3.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
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
#condition ⇒ String
TODO: Write general description for this method
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_url ⇒ String
TODO: Write general description for this method
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_name ⇒ String
TODO: Write general description for this method
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 |
#sku ⇒ String
TODO: Write general description for this method
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 |
#weight ⇒ Weight
TODO: Write general description for this method
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 |
.names ⇒ Object
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 |
.nullables ⇒ Object
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 |
.optionals ⇒ Object
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
#inspect ⇒ Object
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_s ⇒ Object
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 |