Class: Sass::Selector::Parent
Overview
A parent-referencing selector (&
in Sass).
The function of this is to be replaced by the parent selector
in the nested hierarchy.
Instance Attribute Summary collapse
-
#suffix ⇒ Array<String, Sass::Script::Tree::Node>
readonly
The identifier following the
&
.
Attributes inherited from Simple
Instance Method Summary collapse
-
#initialize(suffix = []) ⇒ Parent
constructor
A new instance of Parent.
-
#to_a
-
#unify(sels)
Always raises an exception.
Methods inherited from Simple
#eql?, #equality_key, #hash, #inspect, #to_s, #unify_namespaces
Constructor Details
#initialize(suffix = []) ⇒ Parent
Returns a new instance of Parent.
36 37 38 |
# File 'lib/sass/selector.rb', line 36
def initialize(suffix = [])
@suffix = suffix
end
|
Instance Attribute Details
#suffix ⇒ Array<String, Sass::Script::Tree::Node> (readonly)
The identifier following the &
. Often empty.
33 34 35 |
# File 'lib/sass/selector.rb', line 33
def suffix
@suffix
end
|
Instance Method Details
#to_a
41 42 43 |
# File 'lib/sass/selector.rb', line 41
def to_a
["&", *@suffix]
end
|
#unify(sels)
Always raises an exception.
49 50 51 |
# File 'lib/sass/selector.rb', line 49
def unify(sels)
raise Sass::SyntaxError.new("[BUG] Cannot unify parent selectors.")
end
|