Module: EasyTag::OggAttributeAccessors
- Included in:
- OggTagger
- Defined in:
- lib/easytag/attributes/ogg.rb
Instance Method Summary collapse
- #album_art_reader(attr_name, **opts) ⇒ Object
- #field_reader(attr_name, fields = nil, **opts) ⇒ Object
Instance Method Details
#album_art_reader(attr_name, **opts) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/easytag/attributes/ogg.rb', line 15 def album_art_reader(attr_name, **opts) opts[:returns] = :list define_method(attr_name) do v = self.class.read_fields(taglib.tag, 'METADATA_BLOCK_PICTURE', **opts) v.collect do |b64_data| pic = TagLib::FLAC::Picture.new pic.parse(Base64.decode64(b64_data)) EasyTag::Image.new(pic.data) end end end |
#field_reader(attr_name, fields = nil, **opts) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/easytag/attributes/ogg.rb', line 7 def field_reader(attr_name, fields = nil, **opts) fields = attr_name.to_s.upcase if fields.nil? define_method(attr_name) do v = self.class.read_fields(taglib.tag, fields, **opts) self.class.post_process(v, **opts) end end |