Class: GeolexicaServer::Generator::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/geolexica_server/generator/base.rb

Overview

Base class for generators in GeolexicaServer

Direct Known Subclasses

Bibliography, Metadata

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/geolexica_server/generator/base.rb', line 13

def initialize(options = {})
  config_file_path =
    options["config_file_path"] ||
    GeolexicaServer::DEFAULT_CONFIG_FILE_PATH

  @config = YAML.load_file(config_file_path)

  unless @config["geolexica"] && @config["geolexica"]["glossary_path"]
    raise StandardError,
          "geolexica.glossary_path is missing in config file."
  end

  @glossary_path = @config["geolexica"]["glossary_path"]
end

Class Method Details

.generate(*args) ⇒ Object



9
10
11
# File 'lib/geolexica_server/generator/base.rb', line 9

def self.generate(*args)
  new(*args).generate
end