Class: Jekyll::LiquidRenderer::File

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll/liquid_renderer/file.rb

Instance Method Summary collapse

Constructor Details

#initialize(renderer, filename) ⇒ File

Returns a new instance of File.



4
5
6
7
# File 'lib/jekyll/liquid_renderer/file.rb', line 4

def initialize(renderer, filename)
  @renderer = renderer
  @filename = filename
end

Instance Method Details

#parse(content) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/jekyll/liquid_renderer/file.rb', line 9

def parse(content)
  measure_time do
    @template = Liquid::Template.parse(content, line_numbers: true)
  end

  self
end

#render(*args) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/jekyll/liquid_renderer/file.rb', line 17

def render(*args)
  measure_time do
    measure_bytes do
      @template.render(*args)
    end
  end
end

#render!(*args) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/jekyll/liquid_renderer/file.rb', line 25

def render!(*args)
  measure_time do
    measure_bytes do
      @template.render!(*args)
    end
  end
end