Class: Less::Tree

Inherits:
Object
  • Object
show all
Defined in:
lib/sprockets/less/functions.rb

Overview

Wrapper for the ‘tree` JavaScript module.

This is not to be confused with Less::Parser::Tree, as Less uses that to wrap the AST (which is actually a tree.RuleSet) resulting from parsing

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Tree

Returns a new instance of Tree.



86
87
88
89
90
# File 'lib/sprockets/less/functions.rb', line 86

def initialize(options)
  @tree = Less.instance_eval { @loader.require('less/tree') }
  @sprockets_context = options[:importer].context
  extend_js Sprockets::Less::Functions
end

Instance Attribute Details

#sprockets_contextObject (readonly)

Returns the value of attribute sprockets_context.



84
85
86
# File 'lib/sprockets/less/functions.rb', line 84

def sprockets_context
  @sprockets_context
end