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 6 def [](key) super(convert_key(key)) end
[]=(key, value)
click to toggle source
Calls superclass method
# File lib/faraday/utils/params_hash.rb, line 10 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 14 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 18 def include?(key) super(convert_key(key)) end
merge(params)
click to toggle source
# File lib/faraday/utils/params_hash.rb, line 34 def merge(params) dup.update(params) end
merge_query(query, encoder = nil)
click to toggle source
# File lib/faraday/utils/params_hash.rb, line 43 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 38 def replace(other) clear update(other) end
to_query(encoder = nil)
click to toggle source
# File lib/faraday/utils/params_hash.rb, line 49 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 26 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 55 def convert_key(key) key.to_s end