Sha256: 16d6bfe980d67aa9bb6239ff580f589e9f86bd17385592889de0c8b431f8e365

Contents?: true

Size: 539 Bytes

Versions: 1

Compression:

Stored size: 539 Bytes

Contents

module RenderingEngine
  class ContentHelpers
    def initialize(file_repo, opts = {})
      @file_repo = file_repo
      @base_path = opts.fetch(:base_path)
      @data      = opts[:data]
    end

    def render(file_relative_path, optional_data = nil)
      file_path = File.join(base_path, file_relative_path)
      rendering_data = optional_data || data

      RenderingEngine::Content.new(file_repo, file_path, data: rendering_data).source
    end

    attr_reader :data

    private

    attr_reader :base_path, :file_repo
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rendering_engine-0.2.0 lib/rendering_engine/content_helpers.rb