Class: GeolexicaServer::Generator::Metadata

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

Overview

Class for generating metadata of the glossary

Instance Method Summary collapse

Methods inherited from Base

generate

Constructor Details

#initialize(options) ⇒ Metadata

Returns a new instance of Metadata.



7
8
9
10
11
12
# File 'lib/geolexica_server/generator/metadata.rb', line 7

def initialize(options)
  super

  @concepts_dir = "#{@glossary_path}/concepts/*.yaml"
  @output_file_name = "metadata.yaml"
end

Instance Method Details

#generateObject



14
15
16
17
18
19
20
21
22
# File 'lib/geolexica_server/generator/metadata.rb', line 14

def generate
  terms = extract_terms

  File.open(@output_file_name, "w") do |file|
    file.write((terms).to_yaml)
  end

  puts "Done."
end