Class: SVT::Recorder::Base
- Inherits:
-
Object
- Object
- SVT::Recorder::Base
- Defined in:
- lib/svt/recorder/base.rb
Instance Attribute Summary collapse
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#bitrate ⇒ Object
readonly
Returns the value of attribute bitrate.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
-
#all_parts ⇒ Object
Yields all
parts
concatenated with base_url. - #bitrates ⇒ Object
- #part_urls(bitrate = '') ⇒ Object
-
#parts ⇒ Object
Returns all parts as an array or yielded one part at a time.
Instance Attribute Details
#base_url ⇒ Object (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 |
#bitrate ⇒ Object (readonly)
Returns the value of attribute bitrate.
9 10 11 |
# File 'lib/svt/recorder/base.rb', line 9 def bitrate @bitrate end |
#title ⇒ Object (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_parts ⇒ Object
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 |
#bitrates ⇒ Object
11 12 13 |
# File 'lib/svt/recorder/base.rb', line 11 def bitrates raise NotImplementedError, 'Bitrates undefined!' end |
#part_urls(bitrate = '') ⇒ Object
15 16 17 |
# File 'lib/svt/recorder/base.rb', line 15 def part_urls(bitrate = '') raise NotImplementedError, 'part_urls undefined!' end |
#parts ⇒ Object
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 |