Class: SVT::Recorder::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/svt/recorder/base.rb

Direct Known Subclasses

Play, Rapport

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#base_urlObject (readonly)

Returns the value of attribute base_url.



8
9
10
# File 'lib/svt/recorder/base.rb', line 8

def base_url
  @base_url
end

#bitrateObject (readonly)

Returns the value of attribute bitrate.



9
10
11
# File 'lib/svt/recorder/base.rb', line 9

def bitrate
  @bitrate
end

#titleObject (readonly)

Returns the value of attribute title.



7
8
9
# File 'lib/svt/recorder/base.rb', line 7

def title
  @title
end

Class Method Details

.record(url) ⇒ Object



19
20
21
# File 'lib/svt/recorder/base.rb', line 19

def self.record(url)
  self.new(url)
end

Instance Method Details

#all_partsObject

Yields all parts concatenated with base_url



24
25
26
27
28
# File 'lib/svt/recorder/base.rb', line 24

def all_parts
  parts do |part|
    yield File.join(base_url, part)
  end
end

#bitratesObject

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/svt/recorder/base.rb', line 11

def bitrates
  raise NotImplementedError, 'Bitrates undefined!'
end

#part_urls(bitrate = '') ⇒ Object

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/svt/recorder/base.rb', line 15

def part_urls(bitrate = '')
  raise NotImplementedError, 'part_urls undefined!'
end

#partsObject

Returns all parts as an array or yielded one part at a time



31
32
33
34
35
36
37
# File 'lib/svt/recorder/base.rb', line 31

def parts
  if block_given?
    @parts.each {|part| yield part }
  else
    @parts
  end
end