Class: DataFoodConsortium::Connector::Offer

Inherits:
Object
  • Object
show all
Includes:
VirtualAssembly::Semantizer::SemanticObject
Defined in:
lib/datafoodconsortium/connector/offer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(semanticId, price: nil, stockLimitation: 0.0, offeredItem: nil, offeredTo: nil) ⇒ Offer

Returns a new instance of Offer.

Parameters:

  • semanticId (String)
  • price (IPrice) (defaults to: nil)
  • stockLimitation (Real) (defaults to: 0.0)
  • offeredItem (ICatalogItem) (defaults to: nil)
  • offeredTo (ICustomerCategory) (defaults to: nil)


49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/datafoodconsortium/connector/offer.rb', line 49

def initialize(semanticId, price: nil, stockLimitation: 0.0, offeredItem: nil, offeredTo: nil)
	super(semanticId)
	@price = price
	@stockLimitation = stockLimitation
	@offeredItem = offeredItem
	@offeredTo = offeredTo
	self.semanticType = "https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#Offer"
	registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#price") { self.price }
	registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#stockLimitation") { self.stockLimitation }
	registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#offeredItem") { self.offeredItem }
	registerSemanticProperty("https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#offeredTo") { self.offeredTo }
end

Instance Attribute Details

#offeredItemICatalogItem

Returns:

  • (ICatalogItem)


39
40
41
# File 'lib/datafoodconsortium/connector/offer.rb', line 39

def offeredItem
  @offeredItem
end

#offeredToICustomerCategory

Returns:

  • (ICustomerCategory)


42
43
44
# File 'lib/datafoodconsortium/connector/offer.rb', line 42

def offeredTo
  @offeredTo
end

#priceIPrice

Returns:

  • (IPrice)


33
34
35
# File 'lib/datafoodconsortium/connector/offer.rb', line 33

def price
  @price
end

#stockLimitationReal

Returns:

  • (Real)


36
37
38
# File 'lib/datafoodconsortium/connector/offer.rb', line 36

def stockLimitation
  @stockLimitation
end