Class: MeducationSDK::EcommerceProduct

Inherits:
Resource
  • Object
show all
Defined in:
lib/meducation_sdk/resources/ecommerce_product.rb

Direct Known Subclasses

EcommerceProductMock

Constant Summary

Constants included from Helpers

Helpers::SDK_TO_SPI_MAPPINGS

Instance Method Summary collapse

Methods inherited from Resource

#created_at, spi_type=, #updated_at

Methods included from Helpers

#sdk_class_for, #sdk_type_for, #spi_type_for

Instance Method Details

#collectionObject



9
10
11
# File 'lib/meducation_sdk/resources/ecommerce_product.rb', line 9

def collection
  item.is_a?(Collection) ? item : (raise MeducationSDKError.new("Item is not a collection. It is a #{item.class.name}"))
end

#itemObject



5
6
7
# File 'lib/meducation_sdk/resources/ecommerce_product.rb', line 5

def item
  @item ||= sdk_class_for(item_type).find(item_id)
end