Class | Rack::Accept::Charset |
In: |
lib/rack/accept/charset.rb
|
Parent: | Object |
Returns an array of character sets from this header that match the given charset, ordered by precedence.
# File lib/rack/accept/charset.rb, line 27 27: def matches(charset) 28: values.select {|v| 29: v == charset || v == '*' 30: }.sort {|a, b| 31: # "*" gets least precedence, any others should be equal. 32: a == '*' ? 1 : (b == '*' ? -1 : 0) 33: } 34: end