Module: LogMagic::TemplatingUtils
- Included in:
- SearchkickExplainer, SearchkickExplainer::BoostExplainerSection, SearchkickExplainer::DisMaxExplainerSection, SearchkickExplainer::MatchExplainerSection, SearchkickExplainer::QueryExplainerSection, SearchkickExplainer::SettingsExplainerSection
- Defined in:
- lib/log_magic/utils/templating_utils.rb
Instance Method Summary collapse
Instance Method Details
#enriche ⇒ Object
13 14 15 |
# File 'lib/log_magic/utils/templating_utils.rb', line 13 def enriche @query_json.gsub!(match_regex, rendered_template) end |
#rendered_template ⇒ Object
2 3 4 5 |
# File 'lib/log_magic/utils/templating_utils.rb', line 2 def rendered_template engine = Haml::Engine.new(File.read(template_path)) engine.render(self) end |
#template_path ⇒ Object
7 8 9 10 11 |
# File 'lib/log_magic/utils/templating_utils.rb', line 7 def template_path File.( File.join(__FILE__, '..', '..', 'explainer_templates', template_name) ) end |