Sha256: ba32088cb96a7ebd6f13345e2beabe2c87f6e0e65e3e18292465ffc7ca29b921

Contents?: true

Size: 435 Bytes

Versions: 11

Compression:

Stored size: 435 Bytes

Contents

class Browser
  module Language
    LANGUAGES = YAML.load_file(File.expand_path("../../../../languages.yml", __FILE__))

    # Set browser's preferred language
    attr_writer :accept_language

    # Return an array with all preferred languages that this browser accepts.
    def accept_language
      @accept_language
        .gsub(/;q=[\d.]+/, "")
        .split(",")
        .map {|l| l.downcase.gsub(/\s/m, "") }
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
browser-1.1.0 lib/browser/methods/language.rb
browser-1.0.1 lib/browser/methods/language.rb
browser-1.0.0 lib/browser/methods/language.rb
browser-0.9.1 lib/browser/methods/language.rb
browser-0.9.0 lib/browser/methods/language.rb
browser-0.8.0 lib/browser/methods/language.rb
browser-0.7.2 lib/browser/methods/language.rb
browser-0.7.1 lib/browser/methods/language.rb
browser-0.7.0 lib/browser/methods/language.rb
browser-0.6.0 lib/browser/methods/language.rb
browser-0.5.0 lib/browser/methods/language.rb