Class: Sass::Selector::Parent
- Inherits:
-
Simple
- Object
- Simple
- Sass::Selector::Parent
- Defined in:
- .ruby-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)
-
#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 = {}) ⇒ Object
-
#unify(sels) ⇒ Object
Always raises an exception.
Methods inherited from Simple
#eql?, #hash, #inspect, #unique?
Constructor Details
#initialize(suffix = nil) ⇒ Parent
Returns a new instance of Parent
37 38 39 |
# File '.ruby-sass/lib/sass/selector.rb', line 37 def initialize(suffix = nil) @suffix = suffix end |
Constructor Details
#initialize(suffix = nil) ⇒ Parent
Returns a new instance of Parent
37 38 39 |
# File '.ruby-sass/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 '.ruby-sass/lib/sass/selector.rb', line 34 def suffix @suffix end |
Instance Method Details
#to_s(opts = {}) ⇒ Object
42 43 44 |
# File '.ruby-sass/lib/sass/selector.rb', line 42 def to_s(opts = {}) "&" + (@suffix || '') end |
#unify(sels) ⇒ Object
Always raises an exception.
50 51 52 |
# File '.ruby-sass/lib/sass/selector.rb', line 50 def unify(sels) raise Sass::SyntaxError.new("[BUG] Cannot unify parent selectors.") end |