Module: EasyTag::VorbisAttributeAccessors

Includes:
BaseAttributeAccessors
Included in:
VorbisAttributes
Defined in:
lib/easytag/attributes/vorbis.rb

Instance Method Summary collapse

Methods included from BaseAttributeAccessors

#audio_prop_reader, #cast, #extract, #post_process, #read_audio_property

Instance Method Details

#read_fields(xiph_comment, fields, **opts) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/easytag/attributes/vorbis.rb', line 8

def read_fields(xiph_comment, fields, **opts)
  fields = Array(fields)
  fields.each do |field|
    next unless xiph_comment.contains?(field)
    data = xiph_comment.field_list_map[field]
    return opts[:returns] == :list ? data : data.first
  end
  opts[:returns] == :list ? [] : nil
end