class Xenon::CharsetRange

Constants

DEFAULT_Q

Attributes

charset[R]
q[R]

Public Class Methods

new(charset, q = DEFAULT_Q) click to toggle source
# File lib/xenon/headers/accept_charset.rb, line 10
def initialize(charset, q = DEFAULT_Q)
  @charset = charset
  @q = Float(q) || DEFAULT_Q
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/xenon/headers/accept_charset.rb, line 15
def <=>(other)
  @q <=> other.q
end
to_s() click to toggle source
# File lib/xenon/headers/accept_charset.rb, line 19
def to_s
  s = @charset.dup
  s << "; q=#{@q}" if @q != DEFAULT_Q
  s
end