Class: Vzaar::Resource::VideoCollection

Inherits:
Array
  • Object
show all
Defined in:
lib/vzaar/resources/video_collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml_body, status_code) ⇒ VideoCollection

Returns a new instance of VideoCollection.



6
7
8
9
10
11
12
13
14
15
# File 'lib/vzaar/resources/video_collection.rb', line 6

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

Instance Attribute Details

#http_status_codeObject (readonly)

Returns the value of attribute http_status_code.



4
5
6
# File 'lib/vzaar/resources/video_collection.rb', line 4

def http_status_code
  @http_status_code
end