Class: Sass::Selector::AbstractSequence

Inherits:
Object
  • Object
show all
Defined in:
/var/www/sass-pages/.haml/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=.

Direct Known Subclasses

CommaSequence, Sequence, SimpleSequence

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

- (String?) filename

The name of the file in which this selector was declared.

Returns:

  • (String, nil)


16
17
18
# File '/var/www/sass-pages/.haml/lib/sass/selector/abstract_sequence.rb', line 16

def filename
  @filename
end

- (Fixnum) line

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

Returns:

  • (Fixnum)


11
12
13
# File '/var/www/sass-pages/.haml/lib/sass/selector/abstract_sequence.rb', line 11

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.

Parameters:

  • (Object) other — The object to test equality against

Returns:

  • (Boolean) — Whether or not this is equal to other


56
57
58
# File '/var/www/sass-pages/.haml/lib/sass/selector/abstract_sequence.rb', line 56

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.

Returns:

  • (Fixnum)


45
46
47
# File '/var/www/sass-pages/.haml/lib/sass/selector/abstract_sequence.rb', line 45

def hash
  @_hash ||= _hash
end