class Object

Constants

Rhino

Public Class Methods

new(options = {}) click to toggle source
# File lib/nashorn/rhino/less.rb, line 96
def initialize(options = {})
  env = {}
  Less.defaults.merge(options).each do |key, val|
    env[key.to_s] =
      case val
      when Symbol, Pathname then val.to_s
      when Array
        val.map!(&:to_s) if key.to_sym == :paths # might contain Pathname-s
        val # keep the original passed Array
      else val # true/false/String/Method
      end
  end
  ###
  env = Less::JavaScript.to_js_hash env
  ###
  @parser = Less::JavaScript.exec { Less['Parser'].new(env) }
end

Public Instance Methods

to_css(opts = {}) click to toggle source
# File lib/nashorn/rhino/less.rb, line 118
def to_css(opts = {})
  ###
  opts = Less::JavaScript.to_js_hash opts
  ###
  Less::JavaScript.exec { @tree.toCSS(opts) }
end