Class: DataFoodConsortium::Connector::CatalogItem
- Inherits:
-
Object
- Object
- DataFoodConsortium::Connector::CatalogItem
- Includes:
- VirtualAssembly::Semantizer::SemanticObject
- Defined in:
- lib/datafoodconsortium/connector/catalog_item.rb
Instance Attribute Summary collapse
-
#offers ⇒ Object
Returns the value of attribute offers.
-
#product ⇒ Object
Returns the value of attribute product.
-
#sku ⇒ Object
Returns the value of attribute sku.
-
#stockLimitation ⇒ Object
Returns the value of attribute stockLimitation.
Instance Method Summary collapse
- #addOffer(offer) ⇒ Object
-
#initialize(product) ⇒ CatalogItem
constructor
A new instance of CatalogItem.
Constructor Details
#initialize(product) ⇒ CatalogItem
Returns a new instance of CatalogItem.
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/datafoodconsortium/connector/catalog_item.rb', line 37 def initialize(product) super() self.semanticType = "http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#CatalogItem" self.product = product self.sku = nil self.stockLimitation = nil self.offers = [] registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#references") { self.product } registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#sku") { self.sku } registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#stockLimitation") { self.stockLimitation } registerSemanticProperty("http://static.datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#offeredThrough") { self.offers } end |
Instance Attribute Details
#offers ⇒ Object
Returns the value of attribute offers.
35 36 37 |
# File 'lib/datafoodconsortium/connector/catalog_item.rb', line 35 def offers @offers end |
#product ⇒ Object
Returns the value of attribute product.
32 33 34 |
# File 'lib/datafoodconsortium/connector/catalog_item.rb', line 32 def product @product end |
#sku ⇒ Object
Returns the value of attribute sku.
33 34 35 |
# File 'lib/datafoodconsortium/connector/catalog_item.rb', line 33 def sku @sku end |
#stockLimitation ⇒ Object
Returns the value of attribute stockLimitation.
34 35 36 |
# File 'lib/datafoodconsortium/connector/catalog_item.rb', line 34 def stockLimitation @stockLimitation end |
Instance Method Details
#addOffer(offer) ⇒ Object
53 54 55 |
# File 'lib/datafoodconsortium/connector/catalog_item.rb', line 53 def addOffer(offer) self.offers.push(offer) end |