class Sass::Script::Funcall
it returns a string representation of the function call.
or if no function with the given name exists
A function call either calls one of the functions in {Script::Functions},
A SassScript parse node representing a function call.
def _perform(environment)
-
(Sass::SyntaxError)
- if the function call raises an ArgumentError
Returns:
-
(Literal)
- The SassScript object that is the value of the function call
Parameters:
-
environment
(Sass::Environment
) -- The environment in which to evaluate the SassScript
def _perform(environment) args = self.args.map {|a| a.perform(environment)} ruby_name = name.gsub('-', '_') unless Sass::Util.has?(:public_instance_method, Functions, ruby_name) && ruby_name !~ /^__/ return Script::String.new("#{name}(#{args.map {|a| a.perform(environment)}.join(', ')})") end result = Functions::EvaluationContext.new(environment.options).send(ruby_name, *args) result.options = environment.options return result rescue ArgumentError => e raise e unless e.backtrace.any? {|t| t =~ /:in `(block in )?(#{name}|perform)'$/} raise Sass::SyntaxError.new("#{e.message} for `#{name}'") end
def children
- See: Node#children -
Returns:
-
(Array
-)
def children @args end
def context=(context)
- See: Node#context= -
Parameters:
-
context
(Symbol
) --
def context=(context) super unless @name == "url" end
def initialize(name, args)
-
name
(Array
) -- See \{#args} -
name
(String
) -- See \{#name}
def initialize(name, args) @name = name @args = args super() end
def inspect
-
(String)
- A string representation of the function call
def inspect "#{name}(#{args.map {|a| a.inspect}.join(', ')})" end
def to_sass(opts = {})
- See: Node#to_sass -
def to_sass(opts = {}) "#{dasherize(name, opts)}(#{args.map {|a| a.to_sass(opts)}.join(', ')})" end