Class Index [+]

Quicksearch

Sass::Selector::CommaSequence

A comma-separated sequence of selectors.

Attributes

members[R]

The comma-separated selector sequences represented by this class.

@return [Array]

Public Class Methods

new(seqs) click to toggle source

@param seqs [Array] See {#members}

    # File lib/sass/selector/comma_sequence.rb, line 12
12:       def initialize(seqs)
13:         @members = seqs
14:       end

Public Instance Methods

do_extend(extends) click to toggle source

Non-destrucively extends this selector with the extensions specified in a hash (which should be populated via {Sass::Tree::Node#cssize}).

@todo Link this to the reference documentation on `@extend`

  when such a thing exists.

@param extends [Haml::Util::SubsetMap{Selector::Simple => Selector::Sequence}]

  The extensions to perform on this selector

@return [CommaSequence] A copy of this selector,

  with extensions made according to `extends`
    # File lib/sass/selector/comma_sequence.rb, line 52
52:       def do_extend(extends)
53:         CommaSequence.new(members.map {|seq| seq.do_extend(extends)}.flatten)
54:       end
inspect() click to toggle source

Returns a string representation of the sequence. This is basically the selector string.

@return [String]

    # File lib/sass/selector/comma_sequence.rb, line 60
60:       def inspect
61:         members.map {|m| m.inspect}.join(", ")
62:       end
resolve_parent_refs(super_cseq) click to toggle source

Resolves the {Parent} selectors within this selector by replacing them with the given parent selector, handling commas appropriately.

@param super_cseq [CommaSequence] The parent selector @return [CommaSequence] This selector, with parent references resolved @raise [Sass::SyntaxError] If a parent selector is invalid

    # File lib/sass/selector/comma_sequence.rb, line 23
23:       def resolve_parent_refs(super_cseq)
24:         if super_cseq.nil?
25:           if @members.any? do |sel|
26:               sel.members.any? do |sel_or_op|
27:                 sel_or_op.is_a?(SimpleSequence) && sel_or_op.members.any? {|ssel| ssel.is_a?(Parent)}
28:               end
29:             end
30:             raise Sass::SyntaxError.new("Base-level rules cannot contain the parent-selector-referencing character '&'.")
31:           end
32:           return self
33:         end
34: 
35:         CommaSequence.new(
36:           super_cseq.members.map do |super_seq|
37:             @members.map {|seq| seq.resolve_parent_refs(super_seq)}
38:           end.flatten)
39:       end
to_a() click to toggle source

@see Simple#to_a

    # File lib/sass/selector/comma_sequence.rb, line 65
65:       def to_a
66:         arr = Haml::Util.intersperse(@members.map {|m| m.to_a}, ", ").flatten
67:         arr.delete("\n")
68:         arr
69:       end

Private Instance Methods

_eql?(other) click to toggle source
    # File lib/sass/selector/comma_sequence.rb, line 77
77:       def _eql?(other)
78:         other.class == self.class && other.members.eql?(self.members)
79:       end
_hash() click to toggle source
    # File lib/sass/selector/comma_sequence.rb, line 73
73:       def _hash
74:         members.hash
75:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.