Methods

Class Index [+]

Quicksearch

Sass::Selector::Pseudo

A pseudoclass (e.g. `:visited`) or pseudoelement (e.g. `::first-line`) selector. It can have arguments (e.g. `:nth-child(2n+1)`).

Attributes

type[R]

The type of the selector. `:class` if this is a pseudoclass selector, `:element` if it’s a pseudoelement.

@return [Symbol]

name[R]

The name of the selector.

@return [Array]

arg[R]

The argument to the selector, or `nil` if no argument was given.

This may include SassScript nodes that will be run during resolution. Note that this should not include SassScript nodes after resolution has taken place.

@return [Array, nil]

Public Class Methods

new(type, name, arg) click to toggle source

@param type [Symbol] See {#type} @param name [Array] The name of the selector @param arg [nil, Array] The argument to the selector,

  or nil if no argument was given
     # File lib/sass/selector.rb, line 309
309:       def initialize(type, name, arg)
310:         @type = type
311:         @name = name
312:         @arg = arg
313:       end

Public Instance Methods

to_a() click to toggle source

@see Selector#to_a

     # File lib/sass/selector.rb, line 316
316:       def to_a
317:         res = [@type == :class ? ":" : "::"] + @name
318:         (res << "(").concat(Haml::Util.strip_string_array(@arg)) << ")" if @arg
319:         res
320:       end
unify(sels) click to toggle source

Returns `nil` if this is a pseudoclass selector and `sels` contains a pseudoclass selector different than this one.

@see Selector#unify

     # File lib/sass/selector.rb, line 326
326:       def unify(sels)
327:         return if type == :element && sels.any? do |sel|
328:           sel.is_a?(Pseudo) && sel.type == :element &&
329:             (sel.name != self.name || sel.arg != self.arg)
330:         end
331:         super
332:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.