Class: Sass::Tree::MixinDefNode

Inherits:
Node show all
Defined in:
lib/sass/tree/mixin_def_node.rb

Overview

A dynamic node representing a mixin definition.

See Also:

Instance Attribute Summary

Attributes inherited from Node

#children, #filename, #line, #options

Instance Method Summary collapse

Methods inherited from Node

#<<, #==, #_to_s, #balance, #interpolate, #invalid_child?, #invisible?, #last, #perform, #perform!, #perform_children, #render, #style, #to_s, #to_sass

Constructor Details

#initialize(name, args) ⇒ MixinDefNode

Returns a new instance of MixinDefNode.

Parameters:

  • name (String)

    The mixin name

  • args (Array<(Script::Node, Script::Node)>)

    The arguments for the mixin. Each element is a tuple containing the variable for argument and the parse tree for the default value of the argument



11
12
13
14
15
# File 'lib/sass/tree/mixin_def_node.rb', line 11

def initialize(name, args)
  @name = name
  @args = args
  super()
end

Instance Method Details

#_perform(environment) ⇒ Object (protected)

Loads the mixin into the environment.

Parameters:

  • environment (Sass::Environment)

    The lexical environment containing variable and mixin values



23
24
25
26
# File 'lib/sass/tree/mixin_def_node.rb', line 23

def _perform(environment)
  environment.set_mixin(@name, Sass::Mixin.new(@name, @args, environment, children))
  []
end