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
- #city ⇒ String
- #country ⇒ String
- #latitude ⇒ Real
- #longitude ⇒ Real
- #postalCode ⇒ String
- #region ⇒ String
- #street ⇒ String
Instance Method Summary collapse
-
#initialize(semanticId, street: nil, postalCode: nil, city: nil, country: nil, latitude: nil, longitude: nil, region: nil) ⇒ Address
constructor
A new instance of Address.
Constructor Details
#initialize(semanticId, street: nil, postalCode: nil, city: nil, country: nil, latitude: nil, longitude: nil, region: nil) ⇒ Address
Returns a new instance of Address.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/datafoodconsortium/connector/address.rb', line 60 def initialize(semanticId, street: nil, postalCode: nil, city: nil, country: nil, latitude: nil, longitude: nil, region: nil) super(semanticId) @street = street @postalCode = postalCode @city = city @country = country @latitude = latitude @longitude = longitude @region = region 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=") registerSemanticProperty("dfc-b:latitude", &method("latitude")).valueSetter = method("latitude=") registerSemanticProperty("dfc-b:longitude", &method("longitude")).valueSetter = method("longitude=") registerSemanticProperty("dfc-b:region", &method("region")).valueSetter = method("region=") 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 |
#latitude ⇒ Real
44 45 46 |
# File 'lib/datafoodconsortium/connector/address.rb', line 44 def latitude @latitude end |
#longitude ⇒ Real
47 48 49 |
# File 'lib/datafoodconsortium/connector/address.rb', line 47 def longitude @longitude end |
#postalCode ⇒ String
35 36 37 |
# File 'lib/datafoodconsortium/connector/address.rb', line 35 def postalCode @postalCode end |
#region ⇒ String
50 51 52 |
# File 'lib/datafoodconsortium/connector/address.rb', line 50 def region @region end |
#street ⇒ String
32 33 34 |
# File 'lib/datafoodconsortium/connector/address.rb', line 32 def street @street end |