Class: SDL::Base::Service

Inherits:
Object
  • Object
show all
Includes:
URIMappedResource
Defined in:
lib/sdl/base/service.rb,
lib/sdl/exporters/rdf_exporter.rb,
lib/sdl/exporters/xml_service_exporter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from URIMappedResource

#uri

Constructor Details

#initialize(symbolic_name) ⇒ Service

Returns a new instance of Service.



6
7
8
9
10
# File 'lib/sdl/base/service.rb', line 6

def initialize(symbolic_name)
  @symbolic_name = symbolic_name

  @facts, @facades = [], []
end

Instance Attribute Details

#compendiumObject

Returns the value of attribute compendium.



4
5
6
# File 'lib/sdl/base/service.rb', line 4

def compendium
  @compendium
end

#factsObject

Returns the value of attribute facts.



4
5
6
# File 'lib/sdl/base/service.rb', line 4

def facts
  @facts
end

#symbolic_nameObject

Returns the value of attribute symbolic_name.



4
5
6
# File 'lib/sdl/base/service.rb', line 4

def symbolic_name
  @symbolic_name
end

Instance Method Details

#fact_class_facts_mapObject



12
13
14
# File 'lib/sdl/base/service.rb', line 12

def fact_class_facts_map
  facts.group_by &:class
end

#to_rdfObject



33
34
35
# File 'lib/sdl/exporters/rdf_exporter.rb', line 33

def to_rdf
  SDL::Exporters::RDFExporter.new(@compendium).export_service(self)
end

#to_xmlObject



40
41
42
# File 'lib/sdl/exporters/xml_service_exporter.rb', line 40

def to_xml
  SDL::Exporters::XMLServiceExporter.new(@compendium).export_service(self)
end