class Rack::Auth::Digest::Params
Constants
- UNQUOTED
Public Class Methods
Source
# File lib/rack/auth/digest.rb, line 66 def self.dequote(str) # From WEBrick::HTTPUtils ret = (/\A"(.*)"\Z/ =~ str) ? $1 : str.dup ret.gsub!(/\\(.)/, "\\1") ret end
Source
# File lib/rack/auth/digest.rb, line 76 def initialize super() yield self if block_given? end
Calls superclass method
Source
# File lib/rack/auth/digest.rb, line 59 def self.parse(str) Params[*split_header_value(str).map do |param| k, v = param.split('=', 2) [k, dequote(v)] end.flatten] end
Source
# File lib/rack/auth/digest.rb, line 72 def self.split_header_value(str) str.scan(/\w+\=(?:"[^\"]+"|[^,]+)/n) end
Public Instance Methods
Source
# File lib/rack/auth/digest.rb, line 82 def [](k) super k.to_s end
Calls superclass method
Source
# File lib/rack/auth/digest.rb, line 86 def []=(k, v) super k.to_s, v.to_s end
Calls superclass method
Source
# File lib/rack/auth/digest.rb, line 98 def quote(str) # From WEBrick::HTTPUtils '"' + str.gsub(/[\\\"]/o, "\\\1") + '"' end
Source
# File lib/rack/auth/digest.rb, line 92 def to_s map do |k, v| "#{k}=#{(UNQUOTED.include?(k) ? v.to_s : quote(v))}" end.join(', ') end