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