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)



50
51
52
# File 'lib/faraday/utils.rb', line 50

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

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



54
55
56
# File 'lib/faraday/utils.rb', line 54

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

- (Object) delete(key)



58
59
60
# File 'lib/faraday/utils.rb', line 58

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

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



62
63
64
# File 'lib/faraday/utils.rb', line 62

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

- (Object) merge(params)



78
79
80
# File 'lib/faraday/utils.rb', line 78

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

- (Object) merge_query(query)



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

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

- (Object) replace(other)



82
83
84
85
# File 'lib/faraday/utils.rb', line 82

def replace(other)
  clear
  update(other)
end

- (Object) to_query



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

def to_query
  Utils.build_query(self)
end

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



70
71
72
73
74
75
# File 'lib/faraday/utils.rb', line 70

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