Class: Less::Node::Selector

Inherits:
String show all
Includes:
Entity
Defined in:
lib/less/engine/nodes/selector.rb

Direct Known Subclasses

Adjacent, Child, Descendant, Pseudo

Constant Summary collapse

Selectors =
{
  :Descendant => '',
  :Child      => '>',
  :Adjacent   => '+',
  :Pseudo     => ':',
  :Sibling    => '~'
}

Instance Attribute Summary

Attributes included from Entity

#parent

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Entity

#inspect, #path, #root, #to_css, #to_s

Methods inherited from String

#blank?, #column_of, #indent, #line_of, #tabto, #treetop_camelize

Constructor Details

#initializeSelector

Returns a new instance of Selector.



14
15
16
# File 'lib/less/engine/nodes/selector.rb', line 14

def initialize
  super Selectors[ self.class.to_s.split('::').last.to_sym ]
end

Class Method Details

.[](key) ⇒ Object



18
19
20
# File 'lib/less/engine/nodes/selector.rb', line 18

def self.[] key
  Node.const_get(Selectors.find {|k, v| v == key }.first)
end