class DotjsSprockets::TiltDot

New tilt template declaration, from the tilt docs: Base class for template implementations Subclasses must implement the prepare method and one of the evaluate or precompiled_template methods.

More info here: github.com/rtomayko/tilt/blob/master/lib/tilt/template.rb

@since 0.1.0

Public Class Methods

default_mime_type() click to toggle source

Define the mime type of the template

@since 0.1.0

# File lib/dotjs_sprockets/tilt_dot.rb, line 16
def self.default_mime_type
  "application/javascript"
end

Public Instance Methods

evaluate(scope, locals, &block) click to toggle source

Execute the compiled template and return the result string

@return [String] the compiled template

@since 0.1.0

# File lib/dotjs_sprockets/tilt_dot.rb, line 32
def evaluate(scope, locals, &block)
  template_name = scope.pathname
  DotjsSprockets::Engine.precompile(template_name)
end
prepare() click to toggle source

Required method definition in order to implement the Tilt::Template interface

@since 0.1.0

# File lib/dotjs_sprockets/tilt_dot.rb, line 24
def prepare
end