Sha256: aabee6c8ca8d3f50fd38211561370d75e022ff144ab82bd418d830af46e62c4e

Contents?: true

Size: 465 Bytes

Versions: 14

Compression:

Stored size: 465 Bytes

Contents

# frozen_string_literal: true

require 'active_support/core_ext/object/blank'

module LittleWeasel
  module Modules
    # Provides methods for normalizing language for a locale.
    module Language
      def language?
        language.present?
      end

      def normalize_language!
        self.language = normalize_language language
      end

      module_function

      def normalize_language(language)
        language&.downcase
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
LittleWeasel-5.0.13 lib/LittleWeasel/modules/language.rb
LittleWeasel-5.0.12 lib/LittleWeasel/modules/language.rb
LittleWeasel-5.0.11 lib/LittleWeasel/modules/language.rb
LittleWeasel-5.0.10 lib/LittleWeasel/modules/language.rb
LittleWeasel-5.0.9 lib/LittleWeasel/modules/language.rb
LittleWeasel-5.0.8 lib/LittleWeasel/modules/language.rb
LittleWeasel-5.0.7 lib/LittleWeasel/modules/language.rb
LittleWeasel-5.0.6 lib/LittleWeasel/modules/language.rb
LittleWeasel-5.0.5 lib/LittleWeasel/modules/language.rb
LittleWeasel-5.0.4 lib/LittleWeasel/modules/language.rb
LittleWeasel-5.0.3 lib/LittleWeasel/modules/language.rb
LittleWeasel-5.0.2 lib/LittleWeasel/modules/language.rb
LittleWeasel-5.0.1 lib/LittleWeasel/modules/language.rb
LittleWeasel-5.0.0 lib/LittleWeasel/modules/language.rb