Class: Less2Sass::Less::Tree::SelectorNode

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

Overview

Represents the full selector of a given RulesetNode.

No equivalent node is present in Sass, it’s the ‘rule` member of Sass::Tree::PropNode, instead.

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

#conditionObject

Returns the value of attribute condition.



12
13
14
# File 'lib/less2sass/less/tree/selector_node.rb', line 12

def condition
  @condition
end

#currentFileInfoHash



14
15
16
# File 'lib/less2sass/less/tree/selector_node.rb', line 14

def currentFileInfo
  @currentFileInfo
end

#elementsArray<Tree::ElementNode>



10
11
12
# File 'lib/less2sass/less/tree/selector_node.rb', line 10

def elements
  @elements
end

#evaldConditionBoolean



16
17
18
# File 'lib/less2sass/less/tree/selector_node.rb', line 16

def evaldCondition
  @evaldCondition
end

#extendListObject

Returns the value of attribute extendList.



11
12
13
# File 'lib/less2sass/less/tree/selector_node.rb', line 11

def extendList
  @extendList
end

Instance Method Details

#to_sassObject

see Node#to_sass

Raises:



19
20
21
22
23
# File 'lib/less2sass/less/tree/selector_node.rb', line 19

def to_sass
  raise UnknownError if @elements.nil?
  return @elements.to_sass unless @elements.is_a?(Array)
  @elements.inject([]) { |selector, element| selector << element.to_sass }
end