Class: Less::Parser::Tree

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

Overview

Abstract LessCSS syntax tree Less. Mainly used to emit CSS

Instance Method Summary collapse

Constructor Details

#initialize(tree) ⇒ Tree

Create a tree from a native javascript object.

Parameters:

  • tree (V8::Object)

    the native less.js tree



91
92
93
# File 'lib/less/parser.rb', line 91

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



99
100
101
# File 'lib/less/parser.rb', line 99

def to_css(options = {})
  Less::JavaScript.exec { @tree.toCSS(options) }
end