Class: GeolexicaServer::Generator::Metadata
- Defined in:
- lib/geolexica_server/generator/metadata.rb
Overview
Class for generating metadata of the glossary
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(options) ⇒ Metadata
constructor
A new instance of Metadata.
Methods inherited from Base
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() super @concepts_dir = "#{@glossary_path}/concepts/*.yaml" @output_file_name = "metadata.yaml" end |
Instance Method Details
#generate ⇒ Object
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 |