Class Sass::Selector::AbstractSequence
In: lib/sass/selector/abstract_sequence.rb
Parent: Object

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.

Methods

==   _specificity   eql?   filename=   has_placeholder?   hash   line=   specificity   to_s  

Attributes

filename  [R]  The name of the file in which this selector was declared.

@return [String, nil]

line  [R]  The line of the Sass template on which this selector was declared.

@return [Fixnum]

Public Instance methods

==(other)

Alias for eql?

Checks equality between this and another object.

Subclasses should define `_eql?` rather than overriding this method, which handles checking class equality and hash equality.

@param other [Object] The object to test equality against @return [Boolean] Whether or not this is equal to `other`

Sets the name of the file in which this selector was declared, or `nil` if it was not declared in a file (e.g. on stdin). This also sets the filename for all child selectors.

@param filename [String, nil] @return [String, nil]

Whether or not this selector sequence contains a placeholder selector. Checks recursively.

Returns a hash code for this sequence.

Subclasses should define `_hash` rather than overriding this method, which automatically handles memoizing the result.

@return [Fixnum]

Sets the line of the Sass template on which this selector was declared. This also sets the line for all child selectors.

@param line [Fixnum] @return [Fixnum]

Returns the specificity of the selector as an integer. The base is given by {Sass::Selector::SPECIFICITY_BASE}.

@return [Fixnum]

Converts the selector into a string. This is the standard selector string, along with any SassScript interpolation that may exist.

@return [String]

Protected Instance methods

[Validate]