Class: CDTOC::TOCReader
- Inherits:
-
Object
- Object
- CDTOC::TOCReader
- Defined in:
- lib/cdtoc/toc_reader.rb
Overview
Reads CD and returns table of contents (start frame of each track).
Instance Attribute Summary collapse
-
#device ⇒ String
readonly
CD/DVD device to read.
Instance Method Summary collapse
-
#initialize(device = '/dev/cdrom') ⇒ TOCReader
constructor
A new instance of TOCReader.
-
#to_s ⇒ String
Stringified TOC.
Constructor Details
#initialize(device = '/dev/cdrom') ⇒ TOCReader
Returns a new instance of TOCReader.
12 13 14 |
# File 'lib/cdtoc/toc_reader.rb', line 12 def initialize(device = '/dev/cdrom') @toc = read end |
Instance Attribute Details
#device ⇒ String (readonly)
Returns CD/DVD device to read.
10 11 12 |
# File 'lib/cdtoc/toc_reader.rb', line 10 def device @device end |
Instance Method Details
#to_s ⇒ String
Returns stringified TOC.
17 18 19 20 21 |
# File 'lib/cdtoc/toc_reader.rb', line 17 def to_s output = [] read.each {|t| output << t.offset} output.join(' ') end |