DFS is working
This commit is contained in:
@@ -2,11 +2,12 @@ module Pruning
|
||||
module HTTP
|
||||
class Query < Struct.new(:name, :indicator_ids)
|
||||
def initialize(params = {})
|
||||
symbolised = params.map { |k, v| { k.to_sym => v } }.reduce({}, :merge)
|
||||
values = members.map do |member|
|
||||
value = params.fetch(member, nil)
|
||||
value = symbolised.fetch(member, nil)
|
||||
next if value.nil?
|
||||
case member
|
||||
when :indicator_ids then value.map(&:to_i) # break on purpose if indicator_ids is not an array
|
||||
when :indicator_ids then value.map(&->(indicator_id) { indicator_id.to_i } ) # break on purpose if indicator_ids is not an array
|
||||
when :name then value.to_s.gsub(/[^A-Za-z]/,'')
|
||||
else value
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user