Module: Browser::Language

Included in:
Browser
Defined in:
lib/browser/methods/language.rb

Constant Summary collapse

LANGUAGES =
YAML.load_file(File.expand_path("../../../../languages.yml", __FILE__))

Instance Attribute Summary collapse

Instance Attribute Details

#accept_languageObject

Return an array with all preferred languages that this browser accepts.



9
10
11
12
13
14
# File 'lib/browser/methods/language.rb', line 9

def accept_language
  @accept_language
    .gsub(/;q=[\d.]+/, "")
    .split(",")
    .map {|l| l.downcase.gsub(/\s/m, "") }
end