Sha256: 9a652338d0271de71780e78aa29daa30364d916d987b3b58f753ab84dc772a7a

Contents?: true

Size: 687 Bytes

Versions: 10

Compression:

Stored size: 687 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'

module UltimateLyrics
  class SongMetadata
    require_sub __FILE__
    common_constructor :data do
      self.data = ::UltimateLyrics::SongMetadata::Field.lists.sources.hash_keys_validate!(data)
    end

    ::UltimateLyrics::SongMetadata::Field.lists.sources.each_value do |field|
      define_method field do
        data.fetch(field)
      end
    end

    # @param field [UltimateLyrics::Field]
    # @return [UltimateLyrics::SongMetadata::Field]
    def field(field)
      UltimateLyrics::SongMetadata::Field.new(self, field)
    end

    def to_s
      data.map { |k, v| "#{k}=#{v}" }.join(', ')
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
ultimate_lyrics-0.1.3 lib/ultimate_lyrics/song_metadata.rb
ehbrs-tools-0.28.3 vendor/ultimate_lyrics/lib/ultimate_lyrics/song_metadata.rb
ehbrs-tools-0.28.2 vendor/ultimate_lyrics/lib/ultimate_lyrics/song_metadata.rb
ehbrs-tools-0.28.1 vendor/ultimate_lyrics/lib/ultimate_lyrics/song_metadata.rb
ultimate_lyrics-0.1.2 lib/ultimate_lyrics/song_metadata.rb
ehbrs-tools-0.28.0 vendor/ultimate_lyrics/lib/ultimate_lyrics/song_metadata.rb
ultimate_lyrics-0.1.1 lib/ultimate_lyrics/song_metadata.rb
ehbrs-tools-0.27.0 vendor/ultimate_lyrics/lib/ultimate_lyrics/song_metadata.rb
ultimate_lyrics-0.1.0 lib/ultimate_lyrics/song_metadata.rb
ehbrs-tools-0.26.0 vendor/ultimate_lyrics/lib/ultimate_lyrics/song_metadata.rb