Class: Less2Sass::Less::Tree::DirectiveNode

Inherits:
Node
  • Object
show all
Defined in:
lib/less2sass/less/tree/directive_node.rb

Overview

Note:

Sits on a new line.

Represents a static CSS directive.

Examples:

- @charset
- @namespace
- @keyframes
- @counter-style
- @document
- @supports

The Sass equivalent is Sass::Tree::DirectiveNode.

See Also:

Instance Attribute Summary collapse

Attributes inherited from Node

#children, #has_children, #has_parent, #line, #parent, #ref_vars

Instance Method Summary collapse

Methods inherited from Node

#<<, #==, #contains_variables?, #creates_context?, #each, #get_referenced_variable_names, #initialize, #transform

Constructor Details

This class inherits a constructor from Less2Sass::Less::Tree::Node

Instance Attribute Details

#currentFileInfoObject

Returns the value of attribute currentFileInfo.



22
23
24
# File 'lib/less2sass/less/tree/directive_node.rb', line 22

def currentFileInfo
  @currentFileInfo
end

#debugInfoObject

Returns the value of attribute debugInfo.



23
24
25
# File 'lib/less2sass/less/tree/directive_node.rb', line 23

def debugInfo
  @debugInfo
end

#indexObject

Returns the value of attribute index.



21
22
23
# File 'lib/less2sass/less/tree/directive_node.rb', line 21

def index
  @index
end

#isRootedObject

Returns the value of attribute isRooted.



24
25
26
# File 'lib/less2sass/less/tree/directive_node.rb', line 24

def isRooted
  @isRooted
end

#nameObject

Returns the value of attribute name.



18
19
20
# File 'lib/less2sass/less/tree/directive_node.rb', line 18

def name
  @name
end

#rulesObject

Returns the value of attribute rules.



20
21
22
# File 'lib/less2sass/less/tree/directive_node.rb', line 20

def rules
  @rules
end

#valueObject

Returns the value of attribute value.



19
20
21
# File 'lib/less2sass/less/tree/directive_node.rb', line 19

def value
  @value
end

Instance Method Details

#to_sass::Sass::Tree::DirectiveNode

Returns:

  • (::Sass::Tree::DirectiveNode)

See Also:



28
29
30
31
32
# File 'lib/less2sass/less/tree/directive_node.rb', line 28

def to_sass
  node = node(::Sass::Tree::DirectiveNode.new(value), line(:new))
  @rules.rules.each { |c| node << c.to_sass } # Not all children should be passed
  node
end