Class: DataFoodConsortium::Connector::Address

Inherits:
Object
  • Object
show all
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

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.

Parameters:

  • semanticId (String)
  • street (String) (defaults to: nil)
  • postalCode (String) (defaults to: nil)
  • city (String) (defaults to: nil)
  • country (String) (defaults to: nil)
  • latitude (Real) (defaults to: nil)
  • longitude (Real) (defaults to: nil)
  • region (String) (defaults to: nil)


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

#cityString

Returns:

  • (String)


38
39
40
# File 'lib/datafoodconsortium/connector/address.rb', line 38

def city
  @city
end

#countryString

Returns:

  • (String)


41
42
43
# File 'lib/datafoodconsortium/connector/address.rb', line 41

def country
  @country
end

#latitudeReal

Returns:

  • (Real)


44
45
46
# File 'lib/datafoodconsortium/connector/address.rb', line 44

def latitude
  @latitude
end

#longitudeReal

Returns:

  • (Real)


47
48
49
# File 'lib/datafoodconsortium/connector/address.rb', line 47

def longitude
  @longitude
end

#postalCodeString

Returns:

  • (String)


35
36
37
# File 'lib/datafoodconsortium/connector/address.rb', line 35

def postalCode
  @postalCode
end

#regionString

Returns:

  • (String)


50
51
52
# File 'lib/datafoodconsortium/connector/address.rb', line 50

def region
  @region
end

#streetString

Returns:

  • (String)


32
33
34
# File 'lib/datafoodconsortium/connector/address.rb', line 32

def street
  @street
end