Sha256: 15bd477e31e5ef9bac57ce894cbb9994904c1157d83b885e00e6af4103f4fee7

Contents?: true

Size: 319 Bytes

Versions: 94

Compression:

Stored size: 319 Bytes

Contents

class LocaleConstraint
  def initialize
    @locales = I18n.available_locales.map(&:to_s)
  end

  def matches?(request)
    if request.params['locale']
      @locales.include?(request.params['locale'])
    else
      true
    end
  end

  def self.available_locales
    /#{I18n.available_locales.join('|')}/
  end
end

Version data entries

94 entries across 94 versions & 1 rubygems

Version Path
station-0.4.6 lib/nexmo_developer/app/constraints/locale_constraint.rb
station-0.4.5 lib/nexmo_developer/app/constraints/locale_constraint.rb
station-0.4.4 lib/nexmo_developer/app/constraints/locale_constraint.rb
station-0.4.3 lib/nexmo_developer/app/constraints/locale_constraint.rb
station-0.4.2 lib/nexmo_developer/app/constraints/locale_constraint.rb
station-0.4.1 lib/nexmo_developer/app/constraints/locale_constraint.rb
station-0.4.0 lib/nexmo_developer/app/constraints/locale_constraint.rb
station-0.3.2 lib/nexmo_developer/app/constraints/locale_constraint.rb
station-0.3.1 lib/nexmo_developer/app/constraints/locale_constraint.rb
station-0.3.0 lib/nexmo_developer/app/constraints/locale_constraint.rb
station-0.2.6 lib/nexmo_developer/app/constraints/locale_constraint.rb
station-0.2.5 lib/nexmo_developer/app/constraints/locale_constraint.rb
station-0.2.4 lib/nexmo_developer/app/constraints/locale_constraint.rb
station-0.2.3 lib/nexmo_developer/app/constraints/locale_constraint.rb
station-0.2.2 lib/nexmo_developer/app/constraints/locale_constraint.rb
station-0.2.1 lib/nexmo_developer/app/constraints/locale_constraint.rb
station-0.2.0 lib/nexmo_developer/app/constraints/locale_constraint.rb
station-0.1.8 lib/nexmo_developer/app/constraints/locale_constraint.rb
station-0.1.7 lib/nexmo_developer/app/constraints/locale_constraint.rb
station-0.1.6 lib/nexmo_developer/app/constraints/locale_constraint.rb