Class: Sass::Script::Node

Inherits:
Object show all
Defined in:
lib/sass/script/node.rb

Overview

The abstract superclass for SassScript parse tree nodes.

Use #perform to evaluate a parse tree.

Direct Known Subclasses

Funcall, Literal, Operation, UnaryOperation, Variable

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#options{Symbol => Object}

The options hash for this node.

Returns:



9
10
11
# File 'lib/sass/script/node.rb', line 9

def options
  @options
end

Instance Method Details

#childrenArray<Node>

Returns all child nodes of this node.

Returns:

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/sass/script/node.rb', line 32

def children
  raise NotImplementedError.new("All subclasses of Sass::Script::Node must override #children.")
end

#perform(environment) ⇒ Literal

Evaluates the node.

Parameters:

  • environment (Sass::Environment)

    The environment in which to evaluate the SassScript

Returns:

  • (Literal)

    The SassScript object that is the value of the SassScript

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/sass/script/node.rb', line 25

def perform(environment)
  raise NotImplementedError.new("All subclasses of Sass::Script::Node must override #perform.")
end