Class Sass::Script::Node
In: lib/sass/script/node.rb
Parent: Object

The abstract superclass for SassScript parse tree nodes.

Use \{perform} to evaluate a parse tree.

Methods

_perform   children   context=   dasherize   new   options=   opts   perform   to_sass  

Attributes

context  [R]  The context in which this node was parsed, which determines how some operations are performed.

Can be `:equals`, which means it‘s part of a `$var = val` or `prop = val` assignment, or `:default`, which means it‘s anywhere else (including `$var: val` and `prop: val` assignments, `#{}`-interpolations, and other script contexts such as `@if` conditions).

@return [Symbol]

line  [RW]  The line of the document on which this node appeared.

@return [Fixnum]

options  [R]  The options hash for this node.

@return [{Symbol => Object}]

Public Class methods

Creates a new script node.

Public Instance methods

Returns all child nodes of this node.

@return [Array<Node>]

Sets the context for this node, as well as for all child nodes.

@param context [Symbol] @see context

Sets the options hash for this node, as well as for all child nodes. See {file:SASS_REFERENCE.md#sass_options the Sass options documentation}.

@param options [{Symbol => Object}] The options

Evaluates the node.

\{perform} shouldn‘t be overridden directly; instead, override \{_perform}.

@param environment [Sass::Environment] The environment in which to evaluate the SassScript @return [Literal] The SassScript object that is the value of the SassScript

Returns the text of this SassScript expression.

@return [String]

Protected Instance methods

Evaluates this node. Note that all {Literal} objects created within this method should have their \{options} attribute set, probably via \{opts}.

@param environment [Sass::Environment] The environment in which to evaluate the SassScript @return [Literal] The SassScript object that is the value of the SassScript @see perform

Converts underscores to dashes if the :dasherize option is set.

Sets the \{options} field on the given literal and returns it

@param literal [Literal] @return [Literal]

[Validate]