dotloop_api 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b09a5a0c6ab37b7bce46cd417d7f6aa8f705603fd5752dc961384ea8fa55186
4
- data.tar.gz: c7e2920edc66c3c8bcef1620bf02f3bf89d7ca5a54e38c2256e293fe4d6cc488
3
+ metadata.gz: 9c4df1485544556ae5d926939c327780e11622066ed10f18c661bfe1ea5c5bf1
4
+ data.tar.gz: ea7a6f6b00c47aaf2b8755a54911b22e76ab9cb50bbf9ed4f3bc9532a90ef573
5
5
  SHA512:
6
- metadata.gz: b646d645baccbeadbaf2d69114d61ce9b85cad38e5a30360b32dadce42340fb4b55d53ab33d5ebc13c4b9bff8c5459cd33a0ca9cdf41f71cd4343ed793b811fd
7
- data.tar.gz: a72fa720358aac3218ae485d61ea759f4cb3c6496cedb3c686134498c0ef9b1d03e26dc373ea6df7c182d42be46f742eda84c88c6c5eb961ca65a2dd3a541560
6
+ metadata.gz: cb656e0c08aa557a90a63c8c6207a81c987199d9cdaca30db3058f3943f0fce7c7b5276559e17b13f215c3f1c7463706bc85e4d35a2c5399f57a6e3a8535438d
7
+ data.tar.gz: 12da9a4697d19543d8e472910cac5579054b44fd59720e58d4490291ecb56cef52206424ccdd3d6344d69dbbe4d30cf7c9feae2af75dfc23b6fc90eb6abd746c
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -4,7 +4,7 @@ module DotloopApi
4
4
  include Virtus.model
5
5
  attribute :batch_number, Integer, default: 1
6
6
  attribute :batch_size, Integer, default: 100
7
- attribute :filter
7
+ attribute :filter, Hash
8
8
  attribute :include_details, Boolean, default: false
9
9
  attribute :sort_key
10
10
  attribute :sort_direction, String, default: 'asc'
@@ -18,7 +18,7 @@ module DotloopApi
18
18
  {
19
19
  batch_number: @batch_number.to_i,
20
20
  batch_size: size,
21
- filter: filter_hash,
21
+ filter: filter_string,
22
22
  include_details: @include_details,
23
23
  sort: sort
24
24
  }.delete_if { |_, v| should_delete(v) }
@@ -52,8 +52,14 @@ module DotloopApi
52
52
  ((value.is_a?(String) || value.is_a?(Hash)) && value.empty?)
53
53
  end
54
54
 
55
- def filter_hash
56
- (@filter.to_s.split('&').map { |var| var.split('=') }).to_h.slice(*FILTER_OPTIONS)
55
+ def filter_string
56
+ return unless @filter
57
+ @filter.map { |key, value| filter_pair(key, value) }.compact.join(',')
58
+ end
59
+
60
+ def filter_pair(key, value)
61
+ return unless FILTER_OPTIONS.include?(key.to_s)
62
+ key.to_s + '=' + value.to_s
57
63
  end
58
64
  end
59
65
  end
@@ -1,3 +1,3 @@
1
1
  module DotloopApi
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dotloop_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loft47
@@ -34,7 +34,7 @@ cert_chain:
34
34
  0kvCxR+b/tFBgXiKyctaTk3/79ExegqDId4vd6lLHeVZWUc8KPTsq3DS+L8+MbSy
35
35
  sD7YoNz40ZizOuGGR723hQj/vDgCNGT1I6jOAA==
36
36
  -----END CERTIFICATE-----
37
- date: 2018-11-26 00:00:00.000000000 Z
37
+ date: 2019-02-14 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: activesupport
metadata.gz.sig CHANGED
Binary file