Sha256: 2d26f7a6b03dae6931d8a3d884edb86fa153ee571a63da27668aa591eb067a77

Contents?: true

Size: 478 Bytes

Versions: 1

Compression:

Stored size: 478 Bytes

Contents

module Lunetas::Candy::TemplateParsing
  module InstanceMethods
    # Parses the given file, located in templates/[template_name].erb.
    # @param filename the file located in the templates directory.
    # @return [String] the erb parsed template.
    def erb(filename)
      file = File.expand_path("templates/#{filename}.erb")
      ERB.new(File.read(file)).result(get_binding)
    end

    private
      # @private
      def get_binding
        binding
      end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lunetas-0.1.3 lib/lunetas/candy/template_parsing.rb