Sha256: 63ad9da22823b7f2d965e09e7bda47925dd584b1bf29a64fe93a4416a1049fb8

Contents?: true

Size: 317 Bytes

Versions: 9

Compression:

Stored size: 317 Bytes

Contents

# frozen_string_literal: true

# A namespace for utilities classes and modules
module HeadMusic::Utilities; end

# Util for converting an object to a consistent hash key
module HeadMusic::Utilities::HashKey
  def self.for(identifier)
    I18n.transliterate(identifier.to_s).downcase.gsub(/\W+/, "_").to_sym
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
head_music-4.0.1 lib/head_music/utilities/hash_key.rb
head_music-4.0.0 lib/head_music/utilities/hash_key.rb
head_music-3.0.1 lib/head_music/utilities/hash_key.rb
head_music-3.0.0 lib/head_music/utilities/hash_key.rb
head_music-2.0.1 lib/head_music/utilities/hash_key.rb
head_music-2.0.0 lib/head_music/utilities/hash_key.rb
head_music-1.0.0 lib/head_music/utilities/hash_key.rb
head_music-0.29.0 lib/head_music/utilities/hash_key.rb
head_music-0.28.0 lib/head_music/utilities/hash_key.rb