Class: Rack::Auth::Digest::Params
- Inherits:
-
Hash
show all
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/digest/params.rb
Constant Summary
collapse
- UNQUOTED =
['nc', 'stale']
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Hash
#as_json, #assert_valid_keys, #compact_blank, #compact_blank!, #deep_dup, #deep_merge, #deep_merge!, #deep_stringify_keys, #deep_stringify_keys!, #deep_symbolize_keys, #deep_symbolize_keys!, #deep_transform_keys, #deep_transform_keys!, #deep_transform_values, #deep_transform_values!, #except, #except!, #extract!, #extractable_options?, from_trusted_xml, from_xml, #reverse_merge, #reverse_merge!, #slice!, #stringify_keys, #stringify_keys!, #symbolize_keys, #symbolize_keys!, #to_query, #to_xml, #with_indifferent_access
Constructor Details
#initialize {|_self| ... } ⇒ Params
Returns a new instance of Params.
25
26
27
28
29
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/digest/params.rb', line 25
def initialize
super()
yield self if block_given?
end
|
Class Method Details
.dequote(str) ⇒ Object
15
16
17
18
19
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/digest/params.rb', line 15
def self.dequote(str)
ret = (/\A"(.*)"\Z/ =~ str) ? $1 : str.dup
ret.gsub!(/\\(.)/, "\\1")
ret
end
|
.parse(str) ⇒ Object
8
9
10
11
12
13
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/digest/params.rb', line 8
def self.parse(str)
Params[*(str).map do |param|
k, v = param.split('=', 2)
[k, dequote(v)]
end.flatten]
end
|
21
22
23
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/digest/params.rb', line 21
def self.(str)
str.scan(/\w+\=(?:"[^\"]+"|[^,]+)/n)
end
|
Instance Method Details
31
32
33
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/digest/params.rb', line 31
def [](k)
super k.to_s
end
|
#[]=(k, v) ⇒ Object
35
36
37
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/digest/params.rb', line 35
def []=(k, v)
super k.to_s, v.to_s
end
|
#quote(str) ⇒ Object
47
48
49
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/digest/params.rb', line 47
def quote(str)
'"' + str.gsub(/[\\\"]/o, "\\\1") + '"'
end
|
41
42
43
44
45
|
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/digest/params.rb', line 41
def to_s
map do |k, v|
"#{k}=#{(UNQUOTED.include?(k) ? v.to_s : quote(v))}"
end.join(', ')
end
|