class Sass::Selector::Parent

A parent-referencing selector (‘&` in Sass). The function of this is to be replaced by the parent selector in the nested hierarchy.

Attributes

suffix[R]

The identifier following the ‘&`. `nil` indicates no suffix.

@return [String, nil]

Public Class Methods

new(suffix = nil) click to toggle source

@param name [String, nil] See {#suffix}

# File lib/sass/selector.rb, line 37
def initialize(suffix = nil)
  @suffix = suffix
end

Public Instance Methods

to_s(opts = {}) click to toggle source

@see Selector#to_s

# File lib/sass/selector.rb, line 42
def to_s(opts = {})
  "&" + (@suffix || '')
end
unify(sels) click to toggle source

Always raises an exception.

@raise [Sass::SyntaxError] Parent selectors should be resolved before unification @see Selector#unify

# File lib/sass/selector.rb, line 50
def unify(sels)
  raise Sass::SyntaxError.new("[BUG] Cannot unify parent selectors.")
end