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 ⇒ String?
readonly
The identifier following the
&
.
Attributes inherited from Simple
Instance Method Summary collapse
-
#initialize(suffix = nil) ⇒ Parent
constructor
A new instance of Parent.
- #to_s(opts = {})
-
#unify(sels)
Always raises an exception.
Methods inherited from Simple
#eql?, #equality_key, #hash, #inspect, #unify_namespaces, #unique?
Constructor Details
#initialize(suffix = nil) ⇒ Parent
Returns a new instance of Parent.
37 38 39 |
# File 'lib/sass/selector.rb', line 37
def initialize(suffix = nil)
@suffix = suffix
end
|
Instance Attribute Details
#suffix ⇒ String? (readonly)
The identifier following the &
. nil
indicates no suffix.
34 35 36 |
# File 'lib/sass/selector.rb', line 34
def suffix
@suffix
end
|
Instance Method Details
#to_s(opts = {})
42 43 44 |
# File 'lib/sass/selector.rb', line 42
def to_s(opts = {})
"&" + (@suffix || '')
end
|
#unify(sels)
Always raises an exception.
50 51 52 |
# File 'lib/sass/selector.rb', line 50
def unify(sels)
raise Sass::SyntaxError.new("[BUG] Cannot unify parent selectors.")
end
|