Class: WebRadio
- Inherits:
-
Object
- Object
- WebRadio
- Defined in:
- lib/webradio.rb
Direct Known Subclasses
Defined Under Namespace
Classes: DownloadError
Class Method Summary collapse
Instance Method Summary collapse
- #download(name) ⇒ Object
-
#initialize(url, options) ⇒ WebRadio
constructor
A new instance of WebRadio.
Constructor Details
#initialize(url, options) ⇒ WebRadio
Returns a new instance of WebRadio.
34 35 36 37 38 39 40 41 42 |
# File 'lib/webradio.rb', line 34 def initialize(url, ) raise 'do not instanciate directly, use WebRadio method.' if self.class == WebRadio @url = url @options = if @options.path =~ %r|^dropbox://| require 'dropbox' @dropbox = DropboxAuth.client end end |
Class Method Details
.instance(url, options) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/webradio.rb', line 9 def self.instance(url, ) case url when %r[^http://hibiki-radio\.jp/] require 'hibiki' Hibiki.new(url, ) when %r[^http://sp\.animate\.tv/] require 'animate' Animate.new(url) when %r[^http://onsen\.ag/program/] require 'onsen' Onsen.new(url, ) when %r[^http://seaside-c\.jp/program/], %r[http://nakamuland\.net/] require 'seaside-c' SeasideCommnunications.new(url, ) when %r[nicovideo\.jp] require 'nicovideo' Nicovideo.new(url, ) when %r[www\.youtube\.com] require 'youtube' YouTube.new(url, ) else raise 'unsupported url.' end end |
Instance Method Details
#download(name) ⇒ Object
44 45 46 |
# File 'lib/webradio.rb', line 44 def download(name) raise 'not implemented.' end |