Module: LogMagic::TemplatingUtils

Instance Method Summary collapse

Instance Method Details

#enricheObject



13
14
15
# File 'lib/log_magic/utils/templating_utils.rb', line 13

def enriche
  @query_json.gsub!(match_regex, rendered_template)
end

#rendered_templateObject



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_pathObject



7
8
9
10
11
# File 'lib/log_magic/utils/templating_utils.rb', line 7

def template_path
  File.expand_path(
    File.join(__FILE__, '..', '..', 'explainer_templates', template_name)
  )
end