Class: Lutaml::UmlRepository::StaticSite::Generator
- Inherits:
-
Object
- Object
- Lutaml::UmlRepository::StaticSite::Generator
- Defined in:
- lib/lutaml/uml_repository/static_site/generator.rb
Overview
Orchestrates static site generation.
Thin coordinator that delegates to:
-
DataTransformer for building the typed SpaDocument
-
SearchIndexBuilder for building the typed SpaSearchIndex
-
Output::Strategy subclass for rendering HTML
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#data_transformer ⇒ Object
readonly
Returns the value of attribute data_transformer.
-
#id_generator ⇒ Object
readonly
Returns the value of attribute id_generator.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#search_builder ⇒ Object
readonly
Returns the value of attribute search_builder.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(repository, options = {}) ⇒ Generator
constructor
A new instance of Generator.
Constructor Details
#initialize(repository, options = {}) ⇒ Generator
Returns a new instance of Generator.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/lutaml/uml_repository/static_site/generator.rb', line 24 def initialize(repository, = {}) @repository = repository @config = [:config] || Configuration.load([:config_path]) @options = () @id_generator = [:id_generator] || IdGenerator.new @data_transformer = [:data_transformer] || create_data_transformer @search_builder = [:search_builder] || create_search_builder @output_strategy = resolve_strategy() end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
21 22 23 |
# File 'lib/lutaml/uml_repository/static_site/generator.rb', line 21 def config @config end |
#data_transformer ⇒ Object (readonly)
Returns the value of attribute data_transformer.
21 22 23 |
# File 'lib/lutaml/uml_repository/static_site/generator.rb', line 21 def data_transformer @data_transformer end |
#id_generator ⇒ Object (readonly)
Returns the value of attribute id_generator.
21 22 23 |
# File 'lib/lutaml/uml_repository/static_site/generator.rb', line 21 def id_generator @id_generator end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
21 22 23 |
# File 'lib/lutaml/uml_repository/static_site/generator.rb', line 21 def @options end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
21 22 23 |
# File 'lib/lutaml/uml_repository/static_site/generator.rb', line 21 def repository @repository end |
#search_builder ⇒ Object (readonly)
Returns the value of attribute search_builder.
21 22 23 |
# File 'lib/lutaml/uml_repository/static_site/generator.rb', line 21 def search_builder @search_builder end |
Instance Method Details
#generate ⇒ Object
39 40 41 42 43 44 |
# File 'lib/lutaml/uml_repository/static_site/generator.rb', line 39 def generate spa_document = @data_transformer.transform search_index = @search_builder.build @output_strategy.render(spa_document, search_index) end |