Sha256: c92e5c93bc775457ad74598550c861a04261fde2c17fa207bae23520736ed0fb

Contents?: true

Size: 426 Bytes

Versions: 9

Compression:

Stored size: 426 Bytes

Contents

module Vzaar
  module Resource
    class VideoCollection < Array
      attr_reader :http_status_code

      def initialize(xml_body, status_code)
        @http_status_code = status_code.to_i

        if @http_status_code == 200
          doc = Nokogiri::XML(xml_body)
          doc.xpath("//videos/video").each do |xml|
            push(VideoCollectionItem.new(xml.to_s))
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
vzaar-1.6.2 lib/vzaar/resources/video_collection.rb
vzaar-1.6.1 lib/vzaar/resources/video_collection.rb
vzaar-1.6.0 lib/vzaar/resources/video_collection.rb
vzaar-1.5.3 lib/vzaar/resources/video_collection.rb
vzaar-1.5.2 lib/vzaar/resources/video_collection.rb
vzaar-1.5.1 lib/vzaar/resources/video_collection.rb
vzaar-1.5.0 lib/vzaar/resources/video_collection.rb
vzaar-1.4.4 lib/vzaar/resources/video_collection.rb
vzaar-1.4.1 lib/vzaar/resources/video_collection.rb