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: "", postalCode: "", city: "", country: "") ⇒ Address

Returns a new instance of Address.

Parameters:

  • semanticId (String)
  • street (String) (defaults to: "")
  • postalCode (String) (defaults to: "")
  • city (String) (defaults to: "")
  • country (String) (defaults to: "")


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

#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

#postalCodeString

Returns:

  • (String)


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

def postalCode
  @postalCode
end

#streetString

Returns:

  • (String)


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

def street
  @street
end