Class: Podcast::Mp3File
- Inherits:
-
Object
- Object
- Podcast::Mp3File
- Defined in:
- lib/podcast.rb
Instance Attribute Summary collapse
-
#album ⇒ Object
Returns the value of attribute album.
-
#artist ⇒ Object
Returns the value of attribute artist.
-
#file ⇒ Object
Returns the value of attribute file.
-
#length ⇒ Object
Returns the value of attribute length.
-
#mtime ⇒ Object
Returns the value of attribute mtime.
-
#path ⇒ Object
Returns the value of attribute path.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(f) ⇒ Mp3File
constructor
A new instance of Mp3File.
- #to_s ⇒ Object
Constructor Details
#initialize(f) ⇒ Mp3File
Returns a new instance of Mp3File.
114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/podcast.rb', line 114 def initialize(f) file = File.new(f) info = Mp3Info.open(f) tag = info.tag() @file = f @artist = tag['artist'] @album = tag['album'] @title = tag['title'] @path = file.path() @length = file.stat.size() @mtime = file.stat.mtime() @type = 'audio/mpeg' end |
Instance Attribute Details
#album ⇒ Object
Returns the value of attribute album.
111 112 113 |
# File 'lib/podcast.rb', line 111 def album @album end |
#artist ⇒ Object
Returns the value of attribute artist.
111 112 113 |
# File 'lib/podcast.rb', line 111 def artist @artist end |
#file ⇒ Object
Returns the value of attribute file.
111 112 113 |
# File 'lib/podcast.rb', line 111 def file @file end |
#length ⇒ Object
Returns the value of attribute length.
111 112 113 |
# File 'lib/podcast.rb', line 111 def length @length end |
#mtime ⇒ Object
Returns the value of attribute mtime.
111 112 113 |
# File 'lib/podcast.rb', line 111 def mtime @mtime end |
#path ⇒ Object
Returns the value of attribute path.
111 112 113 |
# File 'lib/podcast.rb', line 111 def path @path end |
#title ⇒ Object
Returns the value of attribute title.
111 112 113 |
# File 'lib/podcast.rb', line 111 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
111 112 113 |
# File 'lib/podcast.rb', line 111 def type @type end |
Instance Method Details
#to_s ⇒ Object
128 129 130 |
# File 'lib/podcast.rb', line 128 def to_s @title end |