wcc-media-client 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6f7fff717257c4c3d0b5d052cc3a6fa470d4d7e
4
- data.tar.gz: 48d5c6b4ea93e3d413bbe88e31f35d8a08437939
3
+ metadata.gz: c0a3f13b858e4857c633577f31c6b20f539f585d
4
+ data.tar.gz: 6b9dcfcc01106db15a135723b10167a760010422
5
5
  SHA512:
6
- metadata.gz: b6daa3c34162ead40627b16a930d8336864a15527c871eb4f02113cfa0a2be6022d26d6ecd3fd53cd19b94c1e63c1b2ed0db0556aafdd2fbc656c2b00ede3a53
7
- data.tar.gz: 2e6c537ea480120c8d72b87b54bf8c79012980df1516c48314cd9d4ee3d48a28cdc8415f4bb8bfe30cc5d0f2d2c6cb4661e4c754d2814b48d87dbb6f6cfb7804
6
+ metadata.gz: 42fb53956ab84dcb4ba25b615c99ce842c75e1aad9fb111f2d9a45c751e2496f9fc458a677e85643f5a07c15c01ca901b86359cdd41c63ab700db90ec1ec0282
7
+ data.tar.gz: 4fcd1a3fcaedb3a0701ee00594902b329412c3dbd2008544d3a0d8fe6652dd78dfefcd4b9d85a4c2befbc54a210360acb9185bdb8e5c5dc3535a2c297ec01c69
@@ -19,11 +19,11 @@ module WCC::Media::ActiveRecordShim
19
19
  end
20
20
 
21
21
  def find(id)
22
- client.public_send(endpoint).find(id)
22
+ WCC::Media::Client.default.public_send(endpoint).find(id)
23
23
  end
24
24
 
25
25
  def find_all(**filters)
26
- client.public_send(endpoint).list(filters)
26
+ WCC::Media::Client.default.public_send(endpoint).list(filters)
27
27
  end
28
28
 
29
29
  def find_by(**filters)
@@ -65,8 +65,6 @@ module WCC::Media::ActiveRecordShim
65
65
  define_singleton_method('filters') { filters }
66
66
  define_singleton_method('endpoint') { endpoint }
67
67
  define_singleton_method('name') { name }
68
- define_singleton_method('client=') { |client| @client = client }
69
- define_singleton_method('client') { @client || WCC::Media::Client.default }
70
68
  end
71
69
  end
72
70
 
@@ -13,6 +13,14 @@ module WCC
13
13
  @raw = raw
14
14
  @headers = headers
15
15
  end
16
+
17
+ def id
18
+ raw['id']&.to_s
19
+ end
20
+
21
+ def legacy_id
22
+ raw['legacy_id']&.to_s
23
+ end
16
24
  end
17
25
  end
18
26
  end
@@ -3,7 +3,7 @@ require_relative '../../../rest_client'
3
3
  module WCC
4
4
  module Media
5
5
  class Client < RestClient
6
- VERSION = '0.2.0'.freeze
6
+ VERSION = '0.2.1'.freeze
7
7
  end
8
8
  end
9
- end
9
+ end
@@ -8,8 +8,13 @@ require_relative 'client/response'
8
8
  module WCC
9
9
  module Media
10
10
  class Client < RestClient
11
- def self.default
12
- @default ||= new
11
+ class << self
12
+ attr_writer :default
13
+ # The default client. Set this in an initializer to change the client used
14
+ # by all the WCC::Media models
15
+ def default
16
+ @default ||= new
17
+ end
13
18
  end
14
19
 
15
20
  PARAMS = %w[
@@ -15,14 +15,6 @@ class WCC::Media::Message < WCC::Media::Base
15
15
  ].freeze
16
16
  end
17
17
 
18
- def id
19
- raw['id']&.to_s
20
- end
21
-
22
- def legacy_id
23
- raw['legacy_id']&.to_s
24
- end
25
-
26
18
  %w[
27
19
  date
28
20
  title
@@ -15,14 +15,6 @@ class WCC::Media::Series < WCC::Media::Base
15
15
  ]
16
16
  end
17
17
 
18
- def id
19
- raw['id']&.to_s
20
- end
21
-
22
- def legacy_id
23
- raw['legacy_id']&.to_s
24
- end
25
-
26
18
  %w[
27
19
  title
28
20
  subtitle
@@ -10,14 +10,6 @@ class WCC::Media::Speaker < WCC::Media::Base
10
10
  ]
11
11
  end
12
12
 
13
- def id
14
- raw['id']&.to_s
15
- end
16
-
17
- def legacy_id
18
- raw['legacy_id']&.to_s
19
- end
20
-
21
13
  %w[
22
14
  featured
23
15
  name
data/lib/wcc/media/tag.rb CHANGED
@@ -8,14 +8,6 @@ class WCC::Media::Tag < WCC::Media::Base
8
8
  ]
9
9
  end
10
10
 
11
- def id
12
- raw['id']&.to_s
13
- end
14
-
15
- def legacy_id
16
- raw['legacy_id']&.to_s
17
- end
18
-
19
11
  %w[
20
12
  name
21
13
  ].each do |att|
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.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Watermark Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-19 00:00:00.000000000 Z
11
+ date: 2018-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -176,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
176
  version: '0'
177
177
  requirements: []
178
178
  rubyforge_project:
179
- rubygems_version: 2.5.2
179
+ rubygems_version: 2.6.11
180
180
  signing_key:
181
181
  specification_version: 4
182
182
  summary: ''