Class: YouTubeG

Inherits:
Object
  • Object
show all
Defined in:
lib/youtube_g/model/video.rb,
lib/youtube_g.rb,
lib/youtube_g/client.rb,
lib/youtube_g/parser.rb,
lib/youtube_g/record.rb,
lib/youtube_g/version.rb,
lib/youtube_g/model/user.rb,
lib/youtube_g/model/author.rb,
lib/youtube_g/model/rating.rb,
lib/youtube_g/model/contact.rb,
lib/youtube_g/model/content.rb,
lib/youtube_g/model/category.rb,
lib/youtube_g/model/playlist.rb,
lib/youtube_g/model/thumbnail.rb,
lib/youtube_g/request/base_search.rb,
lib/youtube_g/request/video_search.rb,
lib/youtube_g/request/video_upload.rb,
lib/youtube_g/response/video_search.rb,
lib/youtube_g/request/standard_search.rb

Overview

TODO

* self atom feed
* alternate youtube watch url
* comments feedLink

Defined Under Namespace

Modules: Logging, Model, Parser, Request, Response, Upload Classes: ChainIO, Client, Error, GreedyChainIO, Record

Constant Summary collapse

VERSION =
'0.5.1'

Class Method Summary collapse

Class Method Details

.esc(s) ⇒ Object

URL-escape a string. Stolen from Camping (wonder how many Ruby libs in the wild can say the same)



15
16
17
# File 'lib/youtube_g.rb', line 15

def self.esc(s) #:nodoc:
  s.to_s.gsub(/[^ \w.-]+/n){'%'+($&.unpack('H2'*$&.size)*'%').upcase}.tr(' ', '+')
end

.loggerObject

Get the logger for the library (by default will log to STDOUT). TODO: this is where we grab the Rails logger too



25
26
27
# File 'lib/youtube_g.rb', line 25

def self.logger
  @logger ||= create_default_logger
end

.logger=(any_logger) ⇒ Object

Set the logger for the library



20
21
22
# File 'lib/youtube_g.rb', line 20

def self.logger=(any_logger)
  @logger = any_logger
end