# frozen_string_literal: true require_dependency "renalware/system" require "liquid" # See https://github.com/Shopify/liquid module Renalware module System class RenderLiquidTemplate def self.call(**args) new.call(**args) end # Takes the #body of a database-stored Template model, parses it with the Liquid gem to insert # variables, and return the resulting html. # Raises an exception id the template is not found or a variable the template requires was # not supplied. # # The body stored in the template#body could be any an html fragment or the whole page, but if # the latter if should be the inner html of the tag and not contain a tag itself # Any