Parent

Included Modules

Files

CSSPool::Collection

Public Class Methods

new(&block) click to toggle source

(Not documented)

# File lib/csspool/collection.rb, line 5
    def initialize &block
      @docs   = []
      @block  = block
    end

Public Instance Methods

<<(string) click to toggle source

(Not documented)

# File lib/csspool/collection.rb, line 10
    def << string
      doc = CSSPool.CSS string

      import_tree = [[doc]]

      imported_urls = {}

      until import_tree.last.all? { |x| x.import_rules.length == 0 }
        level = import_tree.last
        import_tree << []
        level.each do |doc|
          doc.import_rules.each do |ir|
            next if imported_urls.key? ir.uri

            new_doc = ir.load(&@block)

            imported_urls[ir.uri] = ir.load(&@block)
            import_tree.last << new_doc
          end
        end
      end

      @docs += import_tree.flatten.reverse
      self
    end
[](idx) click to toggle source

(Not documented)

# File lib/csspool/collection.rb, line 40
    def [] idx
      @docs[idx]
    end
each(&block) click to toggle source

(Not documented)

# File lib/csspool/collection.rb, line 44
    def each &block
      @docs.each(&block)
    end
last() click to toggle source

(Not documented)

# File lib/csspool/collection.rb, line 48
    def last; @docs.last; end
length() click to toggle source

(Not documented)

# File lib/csspool/collection.rb, line 36
    def length
      @docs.length
    end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.