Sha256: 7f000a03de23e5ae60aef041504182a087ceca2e25cd356517dc1a78f4cd1445

Contents?: true

Size: 1.11 KB

Versions: 31

Compression:

Stored size: 1.11 KB

Contents

module Sass::Script
  # The abstract superclass for SassScript parse tree nodes.
  #
  # Use \{#perform} to evaluate a parse tree.
  class Node
    # The options hash for this node.
    #
    # @return [{Symbol => Object}]
    attr_reader :options

    # 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
    def options=(options)
      @options = options
      children.each {|c| c.options = options}
    end

    # Evaluates the node.
    #
    # @param environment [Sass::Environment] The environment in which to evaluate the SassScript
    # @return [Literal] The SassScript object that is the value of the SassScript
    def perform(environment)
      raise NotImplementedError.new("All subclasses of Sass::Script::Node must override #perform.")
    end

    # Returns all child nodes of this node.
    #
    # @return [Array<Node>]
    def children
      raise NotImplementedError.new("All subclasses of Sass::Script::Node must override #children.")
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
haml-edge-2.3.179 lib/sass/script/node.rb
haml-edge-2.3.178 lib/sass/script/node.rb
haml-edge-2.3.177 lib/sass/script/node.rb
haml-edge-2.3.176 lib/sass/script/node.rb
haml-edge-2.3.175 lib/sass/script/node.rb
haml-edge-2.3.174 lib/sass/script/node.rb
haml-edge-2.3.173 lib/sass/script/node.rb
haml-edge-2.3.172 lib/sass/script/node.rb
haml-edge-2.3.171 lib/sass/script/node.rb
haml-edge-2.3.170 lib/sass/script/node.rb
haml-edge-2.3.169 lib/sass/script/node.rb
haml-edge-2.3.168 lib/sass/script/node.rb
haml-edge-2.3.167 lib/sass/script/node.rb
haml-edge-2.3.166 lib/sass/script/node.rb
haml-edge-2.3.165 lib/sass/script/node.rb
haml-edge-2.3.164 lib/sass/script/node.rb
haml-edge-2.3.163 lib/sass/script/node.rb
haml-edge-2.3.162 lib/sass/script/node.rb
haml-edge-2.3.161 lib/sass/script/node.rb
haml-edge-2.3.160 lib/sass/script/node.rb