Class: Less::Tree

Inherits:
Object
  • Object
show all
Includes:
CallJS
Defined in:
lib/less/parser.rb

Overview

Abstract LessCSS syntax tree Less. Mainly used to emit CSS

Instance Method Summary collapse

Methods included from CallJS

#calljs, #lock

Constructor Details

#initialize(tree) ⇒ Tree

Create a tree from a native javascript object.

Parameters:

  • tree (V8::Object)

    the native less.js tree


78
79
80
# File 'lib/less/parser.rb', line 78

def initialize(tree)
  @tree = tree
end

Instance Method Details

#to_css(options = {}) ⇒ Object

Serialize this tree into CSS. By default this will be in pretty-printed form.

Parameters:

  • opts (Hash)

    modifications to the output


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

def to_css(options = {})
  calljs do
    @tree.toCSS(options)
  end
end