Class: DataFoodConsortium::Connector::PhysicalProduct
- Inherits:
-
Object
- Object
- DataFoodConsortium::Connector::PhysicalProduct
- Includes:
- VirtualAssembly::Semantizer::SemanticObject
- Defined in:
- lib/datafoodconsortium/connector/physical_product.rb
Constant Summary collapse
- SEMANTIC_TYPE =
"dfc-b:PhysicalProduct".freeze
Instance Attribute Summary collapse
- #cost ⇒ Real
- #description ⇒ String
- #images ⇒ String
- #localizedProducts ⇒ ILocalizedProduct
- #name ⇒ String
- #productBatches ⇒ IProductBatch
- #quantity ⇒ IQuantity
- #realizedConsumptionFlows ⇒ IRealizedConsumptionFlow
- #realizedProductionFlows ⇒ IRealizedProductionFlow
- #realStocks ⇒ Real
Instance Method Summary collapse
-
#initialize(semanticId, name: nil, description: nil, images: [], quantity: nil, cost: nil, realStocks: [], localizedProducts: [], productBatches: [], realizedProductionFlows: [], realizedConsumptionFlows: []) ⇒ PhysicalProduct
constructor
A new instance of PhysicalProduct.
Constructor Details
#initialize(semanticId, name: nil, description: nil, images: [], quantity: nil, cost: nil, realStocks: [], localizedProducts: [], productBatches: [], realizedProductionFlows: [], realizedConsumptionFlows: []) ⇒ PhysicalProduct
Returns a new instance of PhysicalProduct.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/datafoodconsortium/connector/physical_product.rb', line 77 def initialize(semanticId, name: nil, description: nil, images: [], quantity: nil, cost: nil, realStocks: [], localizedProducts: [], productBatches: [], realizedProductionFlows: [], realizedConsumptionFlows: []) super(semanticId) @name = name @description = description @images = images @quantity = quantity @cost = cost @realStocks = realStocks @localizedProducts = localizedProducts @productBatches = productBatches @realizedProductionFlows = realizedProductionFlows @realizedConsumptionFlows = realizedConsumptionFlows self.semanticType = "dfc-b:PhysicalProduct" registerSemanticProperty("dfc-b:name", &method("name")).valueSetter = method("name=") registerSemanticProperty("dfc-b:description", &method("description")).valueSetter = method("description=") registerSemanticProperty("dfc-b:image", &method("images")).valueSetter = method("images=") registerSemanticProperty("dfc-b:hasQuantity", &method("quantity")).valueSetter = method("quantity=") registerSemanticProperty("dfc-b:cost", &method("cost")).valueSetter = method("cost=") registerSemanticProperty("dfc-b:constituedBy", &method("realStocks")).valueSetter = method("realStocks=") registerSemanticProperty("dfc-b:represents", &method("localizedProducts")).valueSetter = method("localizedProducts=") registerSemanticProperty("dfc-b:tracedBy", &method("productBatches")).valueSetter = method("productBatches=") registerSemanticProperty("dfc-b:producedBy", &method("realizedProductionFlows")).valueSetter = method("realizedProductionFlows=") registerSemanticProperty("dfc-b:consumedBy", &method("realizedConsumptionFlows")).valueSetter = method("realizedConsumptionFlows=") end |
Instance Attribute Details
#cost ⇒ Real
49 50 51 |
# File 'lib/datafoodconsortium/connector/physical_product.rb', line 49 def cost @cost end |
#description ⇒ String
40 41 42 |
# File 'lib/datafoodconsortium/connector/physical_product.rb', line 40 def description @description end |
#images ⇒ String
43 44 45 |
# File 'lib/datafoodconsortium/connector/physical_product.rb', line 43 def images @images end |
#localizedProducts ⇒ ILocalizedProduct
55 56 57 |
# File 'lib/datafoodconsortium/connector/physical_product.rb', line 55 def localizedProducts @localizedProducts end |
#name ⇒ String
37 38 39 |
# File 'lib/datafoodconsortium/connector/physical_product.rb', line 37 def name @name end |
#productBatches ⇒ IProductBatch
58 59 60 |
# File 'lib/datafoodconsortium/connector/physical_product.rb', line 58 def productBatches @productBatches end |
#quantity ⇒ IQuantity
46 47 48 |
# File 'lib/datafoodconsortium/connector/physical_product.rb', line 46 def quantity @quantity end |
#realizedConsumptionFlows ⇒ IRealizedConsumptionFlow
64 65 66 |
# File 'lib/datafoodconsortium/connector/physical_product.rb', line 64 def realizedConsumptionFlows @realizedConsumptionFlows end |
#realizedProductionFlows ⇒ IRealizedProductionFlow
61 62 63 |
# File 'lib/datafoodconsortium/connector/physical_product.rb', line 61 def realizedProductionFlows @realizedProductionFlows end |
#realStocks ⇒ Real
52 53 54 |
# File 'lib/datafoodconsortium/connector/physical_product.rb', line 52 def realStocks @realStocks end |