Class: DataFoodConsortium::Connector::ProductBatch
- Inherits:
-
Object
- Object
- DataFoodConsortium::Connector::ProductBatch
- Includes:
- VirtualAssembly::Semantizer::SemanticObject
- Defined in:
- lib/datafoodconsortium/connector/product_batch.rb
Constant Summary collapse
- SEMANTIC_TYPE =
"dfc-b:ProductBatch".freeze
Instance Attribute Summary collapse
- #batchNumber ⇒ String
- #bestBeforeDate ⇒ DateTime
- #description ⇒ String
- #expirationDate ⇒ DateTime
- #name ⇒ String
- #physicalProduct ⇒ IPhysicalProduct
- #productionDate ⇒ DateTime
- #realStock ⇒ IRealStock
Instance Method Summary collapse
-
#initialize(semanticId, name: nil, description: nil, batchNumber: nil, realStock: nil, physicalProduct: nil, bestBeforeDate: nil, expirationDate: nil, productionDate: nil) ⇒ ProductBatch
constructor
A new instance of ProductBatch.
Constructor Details
#initialize(semanticId, name: nil, description: nil, batchNumber: nil, realStock: nil, physicalProduct: nil, bestBeforeDate: nil, expirationDate: nil, productionDate: nil) ⇒ ProductBatch
Returns a new instance of ProductBatch.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/datafoodconsortium/connector/product_batch.rb', line 67 def initialize(semanticId, name: nil, description: nil, batchNumber: nil, realStock: nil, physicalProduct: nil, bestBeforeDate: nil, expirationDate: nil, productionDate: nil) super(semanticId) @name = name @description = description @batchNumber = batchNumber @realStock = realStock @physicalProduct = physicalProduct @bestBeforeDate = bestBeforeDate @expirationDate = expirationDate @productionDate = productionDate self.semanticType = "dfc-b:ProductBatch" registerSemanticProperty("dfc-b:name", &method("name")).valueSetter = method("name=") registerSemanticProperty("dfc-b:description", &method("description")).valueSetter = method("description=") registerSemanticProperty("dfc-b:batchNumber", &method("batchNumber")).valueSetter = method("batchNumber=") registerSemanticProperty("dfc-b:identifiedBy", &method("realStock")).valueSetter = method("realStock=") registerSemanticProperty("dfc-b:contains", &method("physicalProduct")).valueSetter = method("physicalProduct=") registerSemanticProperty("dfc-b:bestBeforeDate", &method("bestBeforeDate")).valueSetter = method("bestBeforeDate=") registerSemanticProperty("dfc-b:expirationDate", &method("expirationDate")).valueSetter = method("expirationDate=") registerSemanticProperty("dfc-b:productionDate", &method("productionDate")).valueSetter = method("productionDate=") end |
Instance Attribute Details
#batchNumber ⇒ String
41 42 43 |
# File 'lib/datafoodconsortium/connector/product_batch.rb', line 41 def batchNumber @batchNumber end |
#bestBeforeDate ⇒ DateTime
50 51 52 |
# File 'lib/datafoodconsortium/connector/product_batch.rb', line 50 def bestBeforeDate @bestBeforeDate end |
#description ⇒ String
38 39 40 |
# File 'lib/datafoodconsortium/connector/product_batch.rb', line 38 def description @description end |
#expirationDate ⇒ DateTime
53 54 55 |
# File 'lib/datafoodconsortium/connector/product_batch.rb', line 53 def expirationDate @expirationDate end |
#name ⇒ String
35 36 37 |
# File 'lib/datafoodconsortium/connector/product_batch.rb', line 35 def name @name end |
#physicalProduct ⇒ IPhysicalProduct
47 48 49 |
# File 'lib/datafoodconsortium/connector/product_batch.rb', line 47 def physicalProduct @physicalProduct end |
#productionDate ⇒ DateTime
56 57 58 |
# File 'lib/datafoodconsortium/connector/product_batch.rb', line 56 def productionDate @productionDate end |
#realStock ⇒ IRealStock
44 45 46 |
# File 'lib/datafoodconsortium/connector/product_batch.rb', line 44 def realStock @realStock end |