Class | Sass::Selector::Id
In: | lib/sass/selector.rb
Parent: | Simple

An id selector (e.g. `foo`).

### Methods

new to_a unify

### Attributes

name | [R] | The id name. @return [Array<String, Sass::Script::Node>]

### Public Class methods

new(name)

@param name [Array<String, Sass::Script::Node>] The id name

[Source]

        # File lib/sass/selector.rb, line 65
    65:       def initialize(name)
    66:         @name = name
    67:       end

### Public Instance methods

to_a()

@see Selector#to_a

[Source]

        # File lib/sass/selector.rb, line 70
    70:       def to_a
    71:         ["#", *@name]
    72:       end

unify(sels)

Returns `nil` if `sels` contains an {Id} selector with a different name than this one.

@see Selector#unify

[Source]

        # File lib/sass/selector.rb, line 78
    78:       def unify(sels)
    79:         return if sels.any? {|sel2| sel2.is_a?(Id) && self.name != sel2.name}
    80:         super
    81:       end

[Validate]