class Faraday::Utils::ParamsHash
A hash with stringified keys.
Public Instance Methods
[](key)
click to toggle source
Calls superclass method
# File lib/faraday/utils/params_hash.rb, line 7 def [](key) super(convert_key(key)) end
[]=(key, value)
click to toggle source
Calls superclass method
# File lib/faraday/utils/params_hash.rb, line 11 def []=(key, value) super(convert_key(key), value) end
delete(key)
click to toggle source
Calls superclass method
# File lib/faraday/utils/params_hash.rb, line 15 def delete(key) super(convert_key(key)) end
include?(key)
click to toggle source
Calls superclass method
# File lib/faraday/utils/params_hash.rb, line 19 def include?(key) super(convert_key(key)) end
merge(params)
click to toggle source
# File lib/faraday/utils/params_hash.rb, line 35 def merge(params) dup.update(params) end
merge_query(query, encoder = nil)
click to toggle source
# File lib/faraday/utils/params_hash.rb, line 44 def merge_query(query, encoder = nil) return self unless query && !query.empty? update((encoder || Utils.default_params_encoder).decode(query)) end
replace(other)
click to toggle source
# File lib/faraday/utils/params_hash.rb, line 39 def replace(other) clear update(other) end
to_query(encoder = nil)
click to toggle source
# File lib/faraday/utils/params_hash.rb, line 50 def to_query(encoder = nil) (encoder || Utils.default_params_encoder).encode(self) end
update(params)
click to toggle source
# File lib/faraday/utils/params_hash.rb, line 27 def update(params) params.each do |key, value| self[key] = value end self end
Also aliased as: merge!
Private Instance Methods
convert_key(key)
click to toggle source
# File lib/faraday/utils/params_hash.rb, line 56 def convert_key(key) key.to_s end