Sha256: 7184025ea8c8ae25d8999dce9251150ae84a9e75474cb0aed2c7bee934a25f8a

Contents?: true

Size: 569 Bytes

Versions: 5

Compression:

Stored size: 569 Bytes

Contents

# typed: false
# frozen_string_literal: true

require 'singleton'

module Frontman
  class Renderer
    include Singleton

    def compile(_layout)
      raise('Should be implemented in child classes')
    end

    def render(compiled, content, scope, data)
      Frontman::App.instance.view_data.push(data)
      content = render_content(compiled, content, scope, data)
      Frontman::App.instance.view_data.pop

      content
    end

    def render_content(_compiled, _content, _scope, _data)
      raise('Should be implemented in child classes')
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
frontman-ssg-0.1.1 lib/frontman/renderers/renderer.rb
frontman-ssg-0.1.0 lib/frontman/renderers/renderer.rb
frontman-ssg-0.0.4 lib/frontman/renderers/renderer.rb
frontman-ssg-0.0.3 lib/frontman/renderers/renderer.rb
frontman-ssg-0.0.2 lib/frontman/renderers/renderer.rb