class WhatTheGem::Template
Public Class Methods
parse(src)
click to toggle source
# File lib/whatthegem/template.rb, line 34 def self.parse(src) new.parse(src.chomp.gsub(/\n *({%.+?%})\n/, "\\1\n")) end
Public Instance Methods
parse(src)
click to toggle source
Calls superclass method
# File lib/whatthegem/template.rb, line 38 def parse(src) super(src, error_mode: :strict) end
render(data, **options)
click to toggle source
Calls superclass method
# File lib/whatthegem/template.rb, line 42 def render(data, **options) super(Hm.(data).transform_keys(&:to_s).to_h, filters: [Filters], **options) end
Also aliased as: call
to_proc()
click to toggle source
# File lib/whatthegem/template.rb, line 48 def to_proc # proc { |data| render(data) } method(:call).to_proc end