Method: Sass::Script::Functions#function_exists

Defined in:
lib/sass/script/functions.rb

#function_exists($name) ⇒ Sass::Script::Value::Bool

Check whether a function with the given name exists.

Examples:

function-exists(lighten) => true

@function myfunc { @return "something"; }
function-exists(myfunc) => true

Parameters:

Returns:



2528
2529
2530
2531
2532
2533
# File 'lib/sass/script/functions.rb', line 2528

def function_exists(name)
  assert_type name, :String, :name
  exists = Sass::Script::Functions.callable?(name.value.tr("-", "_"))
  exists ||= environment.caller.function(name.value)
  bool(exists)
end