Class: Rutaci::TaglibSource
- Defined in:
- lib/rutaci/taglib_source.rb
Overview
This class collects the taginfo from various sources.
Instance Attribute Summary collapse
-
#info ⇒ Object
readonly
Returns the value of attribute info.
Instance Method Summary collapse
- #get_fields(fieldlist) ⇒ Object
-
#initialize(filename, options) ⇒ TaglibSource
constructor
A new instance of TaglibSource.
Methods inherited from Source
Constructor Details
#initialize(filename, options) ⇒ TaglibSource
Returns a new instance of TaglibSource.
24 25 26 27 28 |
# File 'lib/rutaci/taglib_source.rb', line 24 def initialize(filename, ) raise ArgumentError, "options.fields need to be an array" unless .fields.class == Array @tagfile = TagFile::File.new filename @info = self.get_fields .fields end |
Instance Attribute Details
#info ⇒ Object (readonly)
Returns the value of attribute info.
23 24 25 |
# File 'lib/rutaci/taglib_source.rb', line 23 def info @info end |
Instance Method Details
#get_fields(fieldlist) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/rutaci/taglib_source.rb', line 30 def get_fields(fieldlist) info = Hash.new fieldlist.each do |field| info[field] = @tagfile.send field end return info end |