def pages(catalogs = nil)
      page_list = []
      catalogs ||= get_existing_catalogs

      if catalogs.is_a?(Array)
        catalogs.each { |c| page_list.concat pages(c) unless c.nil? }
      elsif catalogs.is_a?(Hash)
        if catalogs[:is_reference_only]
          if catalogs[:referenced_object]
            page_list.concat pages(catalogs[:referenced_object])
          else
            warn "couldn't follow reference!!! #{catalogs} not found!"
          end
        else
          case catalogs[:Type]
          when :Page
            page_list << catalogs
          when :Pages
            page_list.concat pages(catalogs[:Kids]) unless catalogs[:Kids].nil?
          when :Catalog
            page_list.concat pages(catalogs[:Pages]) unless catalogs[:Pages].nil?
          end
        end
      end
      page_list
    end
def pages(catalogs = nil)
      page_list = []
      catalogs ||= get_existing_catalogs

      if catalogs.is_a?(Array)
        catalogs.each { |c| page_list.concat pages(c) unless c.nil? }
      elsif catalogs.is_a?(Hash)
        if catalogs[:is_reference_only]
          if catalogs[:referenced_object]
            page_list.concat pages(catalogs[:referenced_object])
          else
            warn "couldn't follow reference!!! #{catalogs} not found!"
          end
        else
          case catalogs[:Type]
          when :Page
            page_list << catalogs
          when :Pages
            page_list.concat pages(catalogs[:Kids]) unless catalogs[:Kids].nil?
          when :Catalog
            page_list.concat pages(catalogs[:Pages]) unless catalogs[:Pages].nil?
          end
        end
      end
      page_list
    end
this method returns all the pages cataloged in the catalog.

 if no catalog is passed, it seeks the existing catalog(s) and searches
 for any registered Page objects.

 Page objects are Hash class objects. the page methods are added using a mixin or inheritance.

 catalogs:: a catalog, or an Array of catalog objects. defaults to the existing catalog.