Sha256: 8a0043ce1abbf6aa3199dacaa8872af7b8362b1e80dedded6fc19bd8ce417c2a

Contents?: true

Size: 280 Bytes

Versions: 10

Compression:

Stored size: 280 Bytes

Contents

# frozen_string_literal: true

module UltimateLyrics
  class Provider
    class ReplaceFields
      common_constructor :metadata, :source_string

      def result
        fields_found.inject(source_string) { |a, e| a.gsub("{#{e}}", metadata.send(e)) }
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

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