frederick_api 0.1.5 → 0.1.6

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
  SHA1:
3
- metadata.gz: eb8dca5b04ce66431f7b3d0a64691e65c6f60c26
4
- data.tar.gz: 14db44aaa05c3c7eece1429ed5b7b7665f43e22d
3
+ metadata.gz: 7636c80bff651fc5077fd459d15e4eed3cfa0153
4
+ data.tar.gz: cc6942cbf2c1b1b050ef78bebbd848b8ac134c55
5
5
  SHA512:
6
- metadata.gz: 17942a838abbcd627cea925ebe3b4ae084fe49907e2e158cfa994fa2dcb1e388cc54f92390d321d11523f6119fa4c42d105f5ff05002db9c5280cef7674d7715
7
- data.tar.gz: ad0a698d3ebf401a9808bb0523f5c8d26a8d7580a3a6b753ce08ccfa72085707162a4a9b9b8f399aa2fdff9c9fac025cb86489078ab5537d0069f472e2d1659c
6
+ metadata.gz: 556a269898c09934171dbf357358d2b95204611ee74db8c26daaabd9e9e0fbcfb70cf248f7feb58e07ea0ce03dd6a41929d036a999a969e376ede0351bac1a87
7
+ data.tar.gz: c3d145b66c28fcfde512017098fab5cd84d2c2f936b7e4a1bcbd252803cf4b55b34bd7f5e5311d21b5a1c2137441f482f29e8bfe83765abd6b049b9053ecd020
@@ -16,6 +16,22 @@ module FrederickAPI
16
16
  .merge(additional_params)
17
17
  end
18
18
 
19
+ def filter_params
20
+ super_filter_params = super
21
+
22
+ if (filters = super_filter_params[:filter])
23
+ filters.each do |filter_name, filter_val|
24
+ filters[filter_name] = filter_val.join(',') if filter_val.is_a?(Array)
25
+ end
26
+ end
27
+
28
+ super_filter_params
29
+ end
30
+
31
+ def all_records
32
+ self.all.pages.all_records
33
+ end
34
+
19
35
  def to_dot_params(object, prefix = nil)
20
36
  return {} if object == {}
21
37
 
@@ -16,8 +16,16 @@ module FrederickAPI
16
16
  super
17
17
  end
18
18
 
19
+ def self.all_records
20
+ self.all.pages.all_records
21
+ end
22
+
23
+ def self.top_level_namespace
24
+ self.to_s.split('::').first.constantize
25
+ end
26
+
19
27
  def self.site
20
- "#{FrederickAPI.config.base_url}/v2/"
28
+ "#{top_level_namespace.config.base_url}/v2/"
21
29
  end
22
30
 
23
31
  def self.with_access_token(token)
@@ -27,7 +35,7 @@ module FrederickAPI
27
35
  end
28
36
 
29
37
  def self.custom_headers
30
- super.merge(x_api_key: FrederickAPI.config.api_key)
38
+ super.merge(x_api_key: top_level_namespace.config.api_key)
31
39
  end
32
40
  end
33
41
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module FrederickAPI
4
4
  # Current gem version
5
- VERSION = '0.1.5'
5
+ VERSION = '0.1.6'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frederick_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frederick Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-09 00:00:00.000000000 Z
11
+ date: 2017-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json_api_client