module Sass::Script::Functions

Public Instance Methods

nanoc(string, params = {}) click to toggle source
# File lib/nanoc/filters/sass/functions.rb, line 4
def nanoc(string, params = {})
  assert_type string, :String
  assert_type params, :Hash
  result = options[:importer].filter.instance_eval(string.value)
  case result
  when TrueClass, FalseClass
    bool(result)
  when Array
    list(result, :comma)
  when Hash
    map(result)
  when nil
    null
  when Numeric
    number(result)
  else
    params['unquote'] ? unquoted_string(result) : quoted_string(result)
  end
end