Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::Item2
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::Item2
- Defined in:
- lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item2.rb
Overview
Item2 Model.
Instance Attribute Summary collapse
-
#brand ⇒ String
TODO: Write general description for this method.
-
#condition ⇒ String
TODO: Write general description for this method.
-
#customer_rating ⇒ String
TODO: Write general description for this method.
-
#description ⇒ String
TODO: Write general description for this method.
-
#images ⇒ Array[Image]
TODO: Write general description for this method.
-
#is_market_place_item ⇒ String
TODO: Write general description for this method.
-
#item_id ⇒ String
TODO: Write general description for this method.
-
#price ⇒ Price1
TODO: Write general description for this method.
-
#product_type ⇒ String
TODO: Write general description for this method.
-
#properties ⇒ Properties1
TODO: Write general description for this method.
-
#title ⇒ String
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(item_id = nil, condition = nil, is_market_place_item = nil, images = nil, customer_rating = nil, price = nil, description = nil, title = nil, brand = nil, product_type = nil, properties = nil) ⇒ Item2
constructor
A new instance of Item2.
-
#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(item_id = nil, condition = nil, is_market_place_item = nil, images = nil, customer_rating = nil, price = nil, description = nil, title = nil, brand = nil, product_type = nil, properties = nil) ⇒ Item2
Returns a new instance of Item2.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item2.rb', line 84 def initialize(item_id = nil, condition = nil, is_market_place_item = nil, images = nil, = nil, price = nil, description = nil, title = nil, brand = nil, product_type = nil, properties = nil) @item_id = item_id @condition = condition @is_market_place_item = is_market_place_item @images = images @customer_rating = @price = price @description = description @title = title @brand = brand @product_type = product_type @properties = properties end |
Instance Attribute Details
#brand ⇒ String
TODO: Write general description for this method
47 48 49 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item2.rb', line 47 def brand @brand end |
#condition ⇒ 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/item2.rb', line 19 def condition @condition end |
#customer_rating ⇒ String
TODO: Write general description for this method
31 32 33 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item2.rb', line 31 def @customer_rating end |
#description ⇒ String
TODO: Write general description for this method
39 40 41 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item2.rb', line 39 def description @description end |
#images ⇒ Array[Image]
TODO: Write general description for this method
27 28 29 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item2.rb', line 27 def images @images end |
#is_market_place_item ⇒ 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/item2.rb', line 23 def is_market_place_item @is_market_place_item end |
#item_id ⇒ 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/item2.rb', line 15 def item_id @item_id end |
#price ⇒ Price1
TODO: Write general description for this method
35 36 37 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item2.rb', line 35 def price @price end |
#product_type ⇒ String
TODO: Write general description for this method
51 52 53 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item2.rb', line 51 def product_type @product_type end |
#properties ⇒ Properties1
TODO: Write general description for this method
55 56 57 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item2.rb', line 55 def properties @properties end |
#title ⇒ String
TODO: Write general description for this method
43 44 45 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item2.rb', line 43 def title @title end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item2.rb', line 102 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. item_id = hash.key?('itemId') ? hash['itemId'] : nil condition = hash.key?('condition') ? hash['condition'] : nil is_market_place_item = hash.key?('isMarketPlaceItem') ? hash['isMarketPlaceItem'] : nil # Parameter is an array, so we need to iterate through it images = nil unless hash['images'].nil? images = [] hash['images'].each do |structure| images << (Image.from_hash(structure) if structure) end end images = nil unless hash.key?('images') = hash.key?('customerRating') ? hash['customerRating'] : nil price = Price1.from_hash(hash['price']) if hash['price'] description = hash.key?('description') ? hash['description'] : nil title = hash.key?('title') ? hash['title'] : nil brand = hash.key?('brand') ? hash['brand'] : nil product_type = hash.key?('productType') ? hash['productType'] : nil properties = Properties1.from_hash(hash['properties']) if hash['properties'] # Create object from extracted values. Item2.new(item_id, condition, is_market_place_item, images, , price, description, title, brand, product_type, properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item2.rb', line 58 def self.names @_hash = {} if @_hash.nil? @_hash['item_id'] = 'itemId' @_hash['condition'] = 'condition' @_hash['is_market_place_item'] = 'isMarketPlaceItem' @_hash['images'] = 'images' @_hash['customer_rating'] = 'customerRating' @_hash['price'] = 'price' @_hash['description'] = 'description' @_hash['title'] = 'title' @_hash['brand'] = 'brand' @_hash['product_type'] = 'productType' @_hash['properties'] = 'properties' @_hash end |
.nullables ⇒ Object
An array for nullable fields
80 81 82 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item2.rb', line 80 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
75 76 77 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item2.rb', line 75 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
153 154 155 156 157 158 159 160 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item2.rb', line 153 def inspect class_name = self.class.name.split('::').last "<#{class_name} item_id: #{@item_id.inspect}, condition: #{@condition.inspect},"\ " is_market_place_item: #{@is_market_place_item.inspect}, images: #{@images.inspect},"\ " customer_rating: #{@customer_rating.inspect}, price: #{@price.inspect}, description:"\ " #{@description.inspect}, title: #{@title.inspect}, brand: #{@brand.inspect}, product_type:"\ " #{@product_type.inspect}, properties: #{@properties.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
144 145 146 147 148 149 150 |
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item2.rb', line 144 def to_s class_name = self.class.name.split('::').last "<#{class_name} item_id: #{@item_id}, condition: #{@condition}, is_market_place_item:"\ " #{@is_market_place_item}, images: #{@images}, customer_rating: #{@customer_rating}, price:"\ " #{@price}, description: #{@description}, title: #{@title}, brand: #{@brand}, product_type:"\ " #{@product_type}, properties: #{@properties}>" end |