Class: Sass::Selector::AbstractSequence
- Inherits:
-
Object
- Object
- Sass::Selector::AbstractSequence
- Defined in:
- /var/www/sass-pages/.sass/lib/sass/selector/abstract_sequence.rb
Overview
The abstract parent class of the various selector sequence classes.
All subclasses should implement a members method that returns an array of object that respond to #line= and #filename=, as well as a to_a method that returns an array of strings and script nodes.
Direct Known Subclasses
Instance Attribute Summary
- - (String?) filename The name of the file in which this selector was declared.
- - (Fixnum) line The line of the Sass template on which this selector was declared.
Instance Method Summary
- - (Boolean) eql?(other) (also: #==) Checks equality between this and another object.
- - (Fixnum) hash Returns a hash code for this sequence.
- - (String) to_s Converts the selector into a string.
Instance Attribute Details
- (String?) filename
The name of the file in which this selector was declared.
17 18 19 |
# File '/var/www/sass-pages/.sass/lib/sass/selector/abstract_sequence.rb', line 17
def filename
@filename
end
|
- (Fixnum) line
The line of the Sass template on which this selector was declared.
12 13 14 |
# File '/var/www/sass-pages/.sass/lib/sass/selector/abstract_sequence.rb', line 12
def line
@line
end
|
Instance Method Details
- (Boolean) eql?(other) Also known as: ==
Checks equality between this and another object.
Subclasses should define #_eql? rather than overriding this method, which handles checking class equality and hash equality.
57 58 59 |
# File '/var/www/sass-pages/.sass/lib/sass/selector/abstract_sequence.rb', line 57
def eql?(other)
other.class == self.class && other.hash == self.hash && _eql?(other)
end
|
- (Fixnum) hash
Returns a hash code for this sequence.
Subclasses should define #_hash rather than overriding this method, which automatically handles memoizing the result.
46 47 48 |
# File '/var/www/sass-pages/.sass/lib/sass/selector/abstract_sequence.rb', line 46
def hash
@_hash ||= _hash
end
|
- (String) to_s
Converts the selector into a string. This is the standard selector string, along with any SassScript interpolation that may exist.
66 67 68 |
# File '/var/www/sass-pages/.sass/lib/sass/selector/abstract_sequence.rb', line 66
def to_s
to_a.map {|e| e.is_a?(Sass::Script::Node) ? "\#{#{e.to_sass}}" : e}.join
end
|