Class: ActiveYoutube
- Inherits:
-
ActiveResource::Base
- Object
- ActiveResource::Base
- ActiveYoutube
- Defined in:
- lib/simple_youtube/activeyoutube.rb
Direct Known Subclasses
Youtube::Playlist, Youtube::Standardfeed, Youtube::User, Youtube::Video
Class Method Summary collapse
-
.convert_entry_to_array(object) ⇒ Object
if youtube only returns a single entry, then convert to an array to standardize subsequent feed processing.
- .find(args) ⇒ Object
Class Method Details
.convert_entry_to_array(object) ⇒ Object
if youtube only returns a single entry, then convert to an array to standardize subsequent feed processing
15 16 17 18 19 20 |
# File 'lib/simple_youtube/activeyoutube.rb', line 15 def self.convert_entry_to_array object if object.respond_to?:entry and !(object.entry.kind_of? Array) object.entry=[object.entry] end object end |
.find(args) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/simple_youtube/activeyoutube.rb', line 7 def self.find(args) scope, type, query = args[:scope], args[:type], args[:params] headers['Accept'] = "application/atom+xml" path = "#{prefix()}#{collection_name}#{'/' if scope}#{scope}#{'/' if type}#{type}#{query_string(query)}" convert_entry_to_array(instantiate_record(connection.get(path, headers))) end |