Sha256: 11631821c2880ef06292c0277fbd55504adca637e6e623c8428a46af460fb219

Contents?: true

Size: 426 Bytes

Versions: 12

Compression:

Stored size: 426 Bytes

Contents

# frozen_string_literal: true

module Sail
  module Types
    # Locales
    #
    # Locales settings will keep an array of locales.
    # If the current I18n.locale is included in the array,
    # the setting will return true.
    class Locales < Array
      def to_value
        @setting.value
                .split(Sail.configuration.array_separator)
                .include?(I18n.locale.to_s)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
sail-3.6.1 lib/sail/types/locales.rb
sail-3.6.0 lib/sail/types/locales.rb
sail-3.5.1 lib/sail/types/locales.rb
sail-3.5.0 lib/sail/types/locales.rb
sail-3.4.0 lib/sail/types/locales.rb
sail-3.3.0 lib/sail/types/locales.rb
sail-3.2.4 lib/sail/types/locales.rb
sail-3.2.3 lib/sail/types/locales.rb
sail-3.2.2 lib/sail/types/locales.rb
sail-3.2.1 lib/sail/types/locales.rb
sail-3.2.0 lib/sail/types/locales.rb
sail-3.1.0 lib/sail/types/locales.rb