wcc-media-client 0.4.2 → 0.4.3

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: 73e31821196ce77ba7ad05d2971f601f1fe1af29
4
- data.tar.gz: 7ed57f7a89406e28c3d4a7e5b104f6240b641e60
3
+ metadata.gz: 62b489a071fa2cb5ad5e5afdf4a970364fb96bae
4
+ data.tar.gz: ea19048322dfc1206a5723ee16849b28d47a1d22
5
5
  SHA512:
6
- metadata.gz: cddd68cff136d47ec7637b4d2756253a20e2a1aacc3bc8c8584182cb6875bee9112358e4cdb475f858acdde140bb21e8330fd6fb724c01b233784023297a725d
7
- data.tar.gz: b6b25f4a13b281953d66233a26a3178b58aebfa975b85643ac620b591817edd86d90a90ee20b655c90221e901fe11b8022dbc96425386b1a6933c60790ebb4a4
6
+ metadata.gz: 8d18ced6d413da9a64493510cc6c5147074361e771c7d1586b2d52dbf5743e59e0418cafc8055006f264a2461503cd563718eda7ff3aed6ba384035ca1db3733
7
+ data.tar.gz: 4438d9438816c76aba2870764a1223909fe3855a52669b8095f792c88325ee6089c34985d155a01862e314d14549f5f6bd76c75805784b89c59429495b3d4749
@@ -28,8 +28,8 @@ module WCC::Media::ActiveRecordShim
28
28
  self
29
29
  end
30
30
 
31
- def find(id)
32
- WCC::Media::Client.default.public_send(endpoint).find(id)
31
+ def find(id, **params)
32
+ WCC::Media::Client.default.public_send(endpoint).find(id, **params)
33
33
  end
34
34
 
35
35
  def find_all(**filters)
@@ -55,8 +55,11 @@ module WCC
55
55
 
56
56
  Resource =
57
57
  Struct.new(:client, :model, :options) do
58
- def find(id)
59
- resp = client.get("#{model.endpoint}/#{id}")
58
+ def find(id, **params)
59
+ resp = client.get(
60
+ "#{model.endpoint}/#{id}",
61
+ default_params('target').merge(params)
62
+ )
60
63
  resp.assert_ok!
61
64
  model.new(resp.body[model.key], resp.headers.freeze)
62
65
  end
@@ -78,10 +81,10 @@ module WCC
78
81
  end
79
82
  end
80
83
 
81
- def default_params
84
+ def default_params(keys = CONFIGURABLE_PARAMS)
82
85
  options.each_with_object({}) do |(k, v), h|
83
86
  k = k.to_s
84
- h[k] = v if !v.nil? && CONFIGURABLE_PARAMS.include?(k)
87
+ h[k] = v if !v.nil? && keys.include?(k)
85
88
  end
86
89
  end
87
90
 
@@ -1,5 +1,5 @@
1
1
  module WCC
2
2
  module Media
3
- VERSION = '0.4.2'.freeze
3
+ VERSION = '0.4.3'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wcc-media-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Watermark Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-31 00:00:00.000000000 Z
11
+ date: 2019-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: wcc-api