Class: Faraday::Utils::ParamsHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/faraday/utils.rb

Overview

hash with stringified keys

Instance Method Summary (collapse)

Instance Method Details

- (Object) [](key)



90
91
92
# File 'lib/faraday/utils.rb', line 90

def [](key)
  super(convert_key(key))
end

- (Object) []=(key, value)



94
95
96
# File 'lib/faraday/utils.rb', line 94

def []=(key, value)
  super(convert_key(key), value)
end

- (Object) delete(key)



98
99
100
# File 'lib/faraday/utils.rb', line 98

def delete(key)
  super(convert_key(key))
end

- (Boolean) include?(key) Also known as: has_key?, member?, key?

Returns:

  • (Boolean)


102
103
104
# File 'lib/faraday/utils.rb', line 102

def include?(key)
  super(convert_key(key))
end

- (Object) merge(params)



118
119
120
# File 'lib/faraday/utils.rb', line 118

def merge(params)
  dup.update(params)
end

- (Object) merge_query(query)



127
128
129
130
131
132
# File 'lib/faraday/utils.rb', line 127

def merge_query(query)
  if query && !query.empty?
    update Utils.parse_query(query)
  end
  self
end

- (Object) replace(other)



122
123
124
125
# File 'lib/faraday/utils.rb', line 122

def replace(other)
  clear
  update(other)
end

- (Object) to_query



134
135
136
# File 'lib/faraday/utils.rb', line 134

def to_query
  Utils.build_nested_query(self)
end

- (Object) update(params) Also known as: merge!



110
111
112
113
114
115
# File 'lib/faraday/utils.rb', line 110

def update(params)
  params.each do |key, value|
    self[key] = value
  end
  self
end