Class: Vzaar::Resource::VideoCollection
- Inherits:
-
Array
- Object
- Array
- Vzaar::Resource::VideoCollection
- Defined in:
- lib/vzaar/resources/video_collection.rb
Instance Attribute Summary collapse
-
#http_status_code ⇒ Object
readonly
Returns the value of attribute http_status_code.
Instance Method Summary collapse
-
#initialize(xml_body, status_code) ⇒ VideoCollection
constructor
A new instance of VideoCollection.
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_code ⇒ Object (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 |