Class: Tilt::SassTemplate

Inherits:
Template show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tilt-2.0.11/lib/tilt/sass.rb

Overview

Sass template implementation. See: haml.hamptoncatlin.com/

Sass templates do not support object scopes, locals, or yield.

Direct Known Subclasses

ScssTemplate

Instance Attribute Summary

Attributes inherited from Template

#data, #file, #line, #options

Instance Method Summary collapse

Methods inherited from Template

#basename, default_mime_type, default_mime_type=, #eval_file, #initialize, metadata, #metadata, #name, #render

Constructor Details

This class inherits a constructor from Tilt::Template

Instance Method Details

#allows_script?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tilt-2.0.11/lib/tilt/sass.rb', line 43

def allows_script?
  false
end

#evaluate(scope, locals, &block) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tilt-2.0.11/lib/tilt/sass.rb', line 35

def evaluate(scope, locals, &block)
  @output ||= if @engine.nil?
                ::Sass.compile_string(data, **sass_embedded_options).css
              else
                @engine.render
              end
end

#prepareObject



29
30
31
32
33
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tilt-2.0.11/lib/tilt/sass.rb', line 29

def prepare
  @engine = unless Engine.nil?
              Engine.new(data, sass_options)
            end
end