Class: Magentwo::Product

Inherits:
Base
  • Object
show all
Defined in:
lib/model/product.rb

Constant Summary collapse

Attributes =
%i(id sku name attribute_set_id price status visibility type_id created_at updated_at extension_attributes product_links options media_gallery_entries tier_prices custom_attributes)

Constants inherited from Base

Base::DatasetMethods

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

[], all, base_path, #call, call, #check_presence, dataset, #delete, each, each_page, first, get, get_path, #initialize, lower_case_name, map, #save, #to_h, #to_json, #validate

Constructor Details

This class inherits a constructor from Magentwo::Base

Class Method Details

.typesObject



11
12
13
# File 'lib/model/product.rb', line 11

def types
  Magentwo::Base.get nil, path:"#{base_path}/types"
end

.unique_identifierObject



15
16
17
# File 'lib/model/product.rb', line 15

def unique_identifier
  :sku
end

Instance Method Details

#stocksObject



6
7
8
# File 'lib/model/product.rb', line 6

def stocks
  Magentwo::StockItem[self.sku]
end