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