Method: Origami::Page#each_content_stream

Defined in:
lib/origami/page.rb

#each_content_streamObject

Iterates over all the ContentStreams of the Page.



656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
# File 'lib/origami/page.rb', line 656

def each_content_stream
    contents = self.Contents

    return enum_for(__method__) do
        case contents
        when Array then contents.length
        when Stream then 1
        else
            0
        end
    end unless block_given?

    case contents
    when Stream then yield(contents)
    when Array then contents.each { |stm| yield(stm.solve) }
    end
end