module Less::Node::Entity

Attributes

parent[RW]

Public Class Methods

new(value, parent = nil) click to toggle source
Calls superclass method
# File lib/less/engine/nodes/entity.rb, line 28
def initialize value, parent = nil
  super value
  @parent = parent
end

Public Instance Methods

inspect() click to toggle source
# File lib/less/engine/nodes/entity.rb, line 51
def inspect;  to_s  end
path(node = self) click to toggle source

Returns the path from any given node, to the root

ex: ['color', 'p', '#header', 'body', '*']
# File lib/less/engine/nodes/entity.rb, line 38
def path node = self
  path = []
  while node do
    path << node
    node = node.parent
  end
  path
end
root() click to toggle source
# File lib/less/engine/nodes/entity.rb, line 47
def root
  path.last
end
to_css() click to toggle source
# File lib/less/engine/nodes/entity.rb, line 52
def to_css;   to_s  end
to_s() click to toggle source
Calls superclass method
# File lib/less/engine/nodes/entity.rb, line 53
def to_s;     super end