Class: DataFoodConsortium::Connector::Address
- Inherits:
-
Object
- Object
- DataFoodConsortium::Connector::Address
- Includes:
- VirtualAssembly::Semantizer::SemanticObject
- Defined in:
- lib/datafoodconsortium/connector/address.rb
Constant Summary collapse
- SEMANTIC_TYPE =
"dfc-b:Address".freeze
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(semanticId, street: "", postalCode: "", city: "", country: "") ⇒ Address
constructor
A new instance of Address.
Constructor Details
#initialize(semanticId, street: "", postalCode: "", city: "", country: "") ⇒ Address
Returns a new instance of Address.
48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/datafoodconsortium/connector/address.rb', line 48 def initialize(semanticId, street: "", postalCode: "", city: "", country: "") super(semanticId) @street = street @postalCode = postalCode @city = city @country = country self.semanticType = "dfc-b:Address" registerSemanticProperty("dfc-b:hasStreet", &method("street")).valueSetter = method("street=") registerSemanticProperty("dfc-b:hasPostalCode", &method("postalCode")).valueSetter = method("postalCode=") registerSemanticProperty("dfc-b:hasCity", &method("city")).valueSetter = method("city=") registerSemanticProperty("dfc-b:hasCountry", &method("country")).valueSetter = method("country=") end |
Instance Attribute Details
#city ⇒ String
38 39 40 |
# File 'lib/datafoodconsortium/connector/address.rb', line 38 def city @city end |
#country ⇒ String
41 42 43 |
# File 'lib/datafoodconsortium/connector/address.rb', line 41 def country @country end |
#postalCode ⇒ String
35 36 37 |
# File 'lib/datafoodconsortium/connector/address.rb', line 35 def postalCode @postalCode end |
#street ⇒ String
32 33 34 |
# File 'lib/datafoodconsortium/connector/address.rb', line 32 def street @street end |