class Sass::Selector::Id - sass-3.4.14 Documentation

# class Sass::Selector::Id

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

### Attributes

name[R]

The id name.

@return [String]

### Public Class Methods

new(name) click to toggle source

@param name [String] The id name

    # File lib/sass/selector.rb, line 86
    def initialize(name)
      @name = name
    end

### Public Instance Methods

specificity() click to toggle source

@see Sass::Selector::AbstractSequence#specificity

    # File lib/sass/selector.rb, line 105
    def specificity
      SPECIFICITY_BASE**2
    end

to_s() click to toggle source

@see Selector#to_s

    # File lib/sass/selector.rb, line 91
    def to_s
      "#" + @name
    end

unify(sels) click to toggle source

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

@see Selector#unify

Calls superclass method

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