diff --git a/lib/dotloop_api/end_points/param_helper.rb b/lib/dotloop_api/end_points/param_helper.rb index 497d564..a7d4a09 100644 --- a/lib/dotloop_api/end_points/param_helper.rb +++ b/lib/dotloop_api/end_points/param_helper.rb @@ -59,7 +59,12 @@ def filter_string def filter_pair(key, value) return unless FILTER_OPTIONS.include?(key.to_s) - key.to_s + '=' + value.to_s + key.to_s + '=' + param_value_parser(value) + end + + def param_value_parser(value) + return value.to_s unless value.is_a?(Array) + value.map(&:to_s).join('|') end end end diff --git a/lib/dotloop_api/version.rb b/lib/dotloop_api/version.rb index 7755496..119b1b5 100644 --- a/lib/dotloop_api/version.rb +++ b/lib/dotloop_api/version.rb @@ -1,3 +1,3 @@ module DotloopApi - VERSION = '0.1.2'.freeze + VERSION = '0.1.3'.freeze end diff --git a/spec/end_points/param_helper_spec.rb b/spec/end_points/param_helper_spec.rb index fd8340d..5e4ce00 100644 --- a/spec/end_points/param_helper_spec.rb +++ b/spec/end_points/param_helper_spec.rb @@ -13,8 +13,8 @@ describe 'filter' do it 'strigfies a given hash' do - filter_hash = { transaction_type: 'PURCHASE_OFFER', transaction_status: 'ARCHIVED' } - filter_string = 'transaction_type=PURCHASE_OFFER,transaction_status=ARCHIVED' + filter_hash = { transaction_type: 'PURCHASE_OFFER', transaction_status: %w[ARCHIVED ACTIVE_LISTING] } + filter_string = 'transaction_type=PURCHASE_OFFER,transaction_status=ARCHIVED|ACTIVE_LISTING' expect(params(filter: filter_hash)).to include(filter: filter_string) end