Class: CustomFormGenerator::Generator
- Inherits:
-
Object
- Object
- CustomFormGenerator::Generator
- Includes:
- Helpers::FieldRenderers, Helpers::FilterSort, Helpers::FormElementRenderer, Helpers::JsonLoader, Helpers::TableRenderer, Helpers::TemplateRender, Helpers::YamlLoader
- Defined in:
- lib/custom_form_generator/generator.rb
Overview
The Generator class is responsible for orchestrating the loading and rendering of form configurations, data, and templates. It integrates various helper modules to process YAML and JSON files, and to render forms and UI components using Slim templates.
Instance Method Summary collapse
-
#initialize(form_yaml, data_json, config_json, table_yaml, debug: false) ⇒ Generator
constructor
A new instance of Generator.
Methods included from Helpers::FormElementRenderer
#render_datetime, #render_dropdown, #render_radio, #render_textbox, #render_textfield
Methods included from Helpers::TableRenderer
#generate_tabular_view, #table_template
Methods included from Helpers::FilterSort
#filter_and_sort_template, #generate_updated_config
Methods included from Helpers::FieldRenderers
Methods included from Helpers::TemplateRender
#filter_and_sort_template, #form_template
Methods included from Helpers::JsonLoader
Methods included from Helpers::YamlLoader
Constructor Details
#initialize(form_yaml, data_json, config_json, table_yaml, debug: false) ⇒ Generator
Returns a new instance of Generator.
27 28 29 30 31 32 |
# File 'lib/custom_form_generator/generator.rb', line 27 def initialize(form_yaml, data_json, config_json, table_yaml, debug: false) load_files(form_yaml, data_json, config_json, table_yaml) @debug = { debug: debug } rescue StandardError => e raise CustomFormGenerator::Error, "Failed to load generator files: #{e.}" end |