Sha256: 687abfcdbaf86b1dbe838b70f86ac822636986373e5258ad399680c2ea6794d8

Contents?: true

Size: 992 Bytes

Versions: 206

Compression:

Stored size: 992 Bytes

Contents

module Sass
  module Tree
    # A dynamic node representing a variable definition.
    #
    # @see Sass::Tree
    class VariableNode < Node
      # @param name [String] The name of the variable
      # @param expr [Script::Node] The parse tree for the initial variable value
      # @param guarded [Boolean] Whether this is a guarded variable assignment (`||=`)
      def initialize(name, expr, guarded)
        @name = name
        @expr = expr
        @guarded = guarded
        super()
      end

      protected

      # Loads the new variable value into the environment.
      #
      # @param environment [Sass::Environment] The lexical environment containing
      #   variable and mixin values
      def _perform(environment)
        if @guarded && environment.var(@name).nil?
          environment.set_var(@name, @expr.perform(environment))
        elsif !@guarded
          environment.set_var(@name, @expr.perform(environment))
        end

        []
      end
    end
  end
end

Version data entries

206 entries across 205 versions & 7 rubygems

Version Path
radiantcms-couchrest_model-0.1.4 vendor/plugins/haml/lib/sass/tree/variable_node.rb
radiant-0.9.1 vendor/plugins/haml/lib/sass/tree/variable_node.rb
haml-2.2.24 lib/sass/tree/variable_node.rb
radiant-0.9.0.rc2 vendor/plugins/haml/lib/sass/tree/variable_node.rb
haml-2.2.23 lib/sass/tree/variable_node.rb
haml-edge-2.3.179 lib/sass/tree/variable_node.rb
haml-edge-2.3.178 lib/sass/tree/variable_node.rb
haml-edge-2.3.177 lib/sass/tree/variable_node.rb
haml-edge-2.3.176 lib/sass/tree/variable_node.rb
haml-edge-2.3.175 lib/sass/tree/variable_node.rb
haml-2.2.22 lib/sass/tree/variable_node.rb
haml-edge-2.3.174 lib/sass/tree/variable_node.rb
haml-edge-2.3.173 lib/sass/tree/variable_node.rb
haml-edge-2.3.172 lib/sass/tree/variable_node.rb
haml-edge-2.3.171 lib/sass/tree/variable_node.rb
haml-edge-2.3.170 lib/sass/tree/variable_node.rb
haml-2.2.21 lib/sass/tree/variable_node.rb
drnic-haml-2.3.1 lib/sass/tree/variable_node.rb
haml-edge-2.3.169 lib/sass/tree/variable_node.rb
haml-edge-2.3.168 lib/sass/tree/variable_node.rb