-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
The #process_kpi method mutates the original options hash, which can cause unexpected results if the calling function isn't aware of this detail:
databox-ruby/lib/databox/client.rb
Lines 41 to 56 in c6356b6
| options.delete_if { |k, _| [:date, 'date'].include?(k) } | |
| %i{key value}.each do |k| | |
| raise("Missing '#{k}'") if (options[k] || options[k.to_s]).nil? | |
| end | |
| options["$#{(options['key'] || options[:key])}"] = options['value'] || options[:value] | |
| options.delete_if { |k, _| [:key, 'key', :value, 'value'].include?(k) } | |
| attributes = options[:attributes] || options['attributes'] | |
| unless attributes.nil? | |
| [:attributes, 'attributes'].each {|k| options.delete(k) } | |
| attributes.each { |k,v| options[k] = v } | |
| end | |
| options |
Metadata
Metadata
Assignees
Labels
No labels