Class: Brut::I18n::HTTPAcceptLanguage::AlwaysEnglish

Inherits:
Brut::I18n::HTTPAcceptLanguage show all
Defined in:
lib/brut/i18n/http_accept_language.rb

Overview

A subclass that represents the use of English and only English. This is used when attempts to determine the locale fail. Instances of this class are considered "unknown" (#known? returns false), which allows Brut to replace this with a known value later on.

Constant Summary

Constants inherited from Brut::I18n::HTTPAcceptLanguage

WeightedLocale

Instance Attribute Summary

Attributes inherited from Brut::I18n::HTTPAcceptLanguage

#weighted_locales

Instance Method Summary collapse

Methods inherited from Brut::I18n::HTTPAcceptLanguage

#for_session, from_browser, from_header, from_session, #to_s

Constructor Details

#initializeAlwaysEnglish

Returns a new instance of AlwaysEnglish.



109
110
111
# File 'lib/brut/i18n/http_accept_language.rb', line 109

def initialize
  super([ WeightedLocale.new(locale: "en", q: 1) ])
end

Instance Method Details

#known?Boolean

Returns:

  • (Boolean)


112
# File 'lib/brut/i18n/http_accept_language.rb', line 112

def known? = false