Class: DataFoodConsortium::Connector::OrderLine

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(semanticId, description: "", quantity: 0.0, price: nil, offer: nil, order: nil) ⇒ OrderLine

Returns a new instance of OrderLine.

Parameters:

  • semanticId (String)
  • description (String) (defaults to: "")
  • quantity (Real) (defaults to: 0.0)
  • price (IPrice) (defaults to: nil)
  • offer (IOffer) (defaults to: nil)
  • order (IOrder) (defaults to: nil)


54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/datafoodconsortium/connector/order_line.rb', line 54

def initialize(semanticId, description: "", quantity: 0.0, price: nil, offer: nil, order: nil)
	super(semanticId)
	@description = description
	@quantity = quantity
	@price = price
	@offer = offer
	@order = order
	self.semanticType = "dfc-b:OrderLine"
	registerSemanticProperty("dfc-b:description") { self.description }
	registerSemanticProperty("dfc-b:quantity") { self.quantity }
	registerSemanticProperty("dfc-b:hasPrice") { self.price }
	registerSemanticProperty("dfc-b:concerns") { self.offer }
	registerSemanticProperty("dfc-b:partOf") { self.order }
end

Instance Attribute Details

#descriptionString

Returns:

  • (String)


34
35
36
# File 'lib/datafoodconsortium/connector/order_line.rb', line 34

def description
  @description
end

#offerIOffer

Returns:

  • (IOffer)


43
44
45
# File 'lib/datafoodconsortium/connector/order_line.rb', line 43

def offer
  @offer
end

#orderIOrder

Returns:

  • (IOrder)


46
47
48
# File 'lib/datafoodconsortium/connector/order_line.rb', line 46

def order
  @order
end

#priceIPrice

Returns:

  • (IPrice)


40
41
42
# File 'lib/datafoodconsortium/connector/order_line.rb', line 40

def price
  @price
end

#quantityReal

Returns:

  • (Real)


37
38
39
# File 'lib/datafoodconsortium/connector/order_line.rb', line 37

def quantity
  @quantity
end