Class: SDL::Exporters::Exporter

Inherits:
Object
  • Object
show all
Defined in:
lib/sdl/exporters/exporter.rb

Direct Known Subclasses

SchemaExporter, ServiceExporter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(compendium, options = {}) ⇒ Exporter

Returns a new instance of Exporter.



5
6
7
8
# File 'lib/sdl/exporters/exporter.rb', line 5

def initialize(compendium, options = {})
  @compendium = compendium
  @options = options
end

Instance Attribute Details

#compendiumObject (readonly)

Returns the value of attribute compendium.



2
3
4
# File 'lib/sdl/exporters/exporter.rb', line 2

def compendium
  @compendium
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/sdl/exporters/exporter.rb', line 3

def options
  @options
end

Instance Method Details

#export_to_file(path, content) ⇒ Object



10
11
12
13
14
# File 'lib/sdl/exporters/exporter.rb', line 10

def export_to_file(path, content)
  File.open(path, 'w') do |f|
    f.write(content)
  end
end