Class: Hippo::Templates::Liquid

Inherits:
Base
  • Object
show all
Defined in:
lib/hippo/templates/liquid.rb

Direct Known Subclasses

Mail

Instance Method Summary collapse

Methods inherited from Base

#class_as_name, #filename, format, #pathname, #root_path, #source

Instance Method Details

#extensionObject


10
11
12
# File 'lib/hippo/templates/liquid.rb', line 10

def extension
    '.liquid'
end

#renderObject


14
15
16
# File 'lib/hippo/templates/liquid.rb', line 14

def render
    template.render(variables.stringify_keys)
end

#templateObject


22
23
24
# File 'lib/hippo/templates/liquid.rb', line 22

def template
    @template ||= ::Liquid::Template.parse(source, :error_mode => :warn)
end

#variablesObject


18
19
20
# File 'lib/hippo/templates/liquid.rb', line 18

def variables
    {}
end