wes-data-api 5.4.0 → 5.5.0

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: 2c6a4159e92994a037d0d38173132f6b7edc55de
4
- data.tar.gz: 83fa4750b4a3dcd647de31aede370c1f8c998002
3
+ metadata.gz: 40810ee00b791376c6280505b3acf8485e7d4629
4
+ data.tar.gz: 63b74d7d0f071cd04f2a761b4c1e530872d04102
5
5
  SHA512:
6
- metadata.gz: 2d23bdff1b1d61c0f670e7fc1fcfc7f59d06b090f1338683af40fd37a48d67be38bc4118d350fe33e6ccaaea03872a037ea92d8b9d5bfbd6b1320d3a4b52a2f9
7
- data.tar.gz: 4b5f9a7e991f825ee808db05f8ef89f4c6f35aba8e85112c5e47a3c461aca004571ef7ade76208bd74dada0b47ea6fb4d09bc07ccfdaf8e3228161e33fa4770d
6
+ metadata.gz: 70e0ad5c5071d1b6e36b46f739eb313d8e5eada0781970ec56d8e76d8ba768bd538214e82fc8a0456ec6e07eb705b9048294ea3c9e08c57e1b798630d6108d48
7
+ data.tar.gz: 332c28b217286178d87f7787574b6146899f50dc219b3c74c5b86f3f79924b910d9d0a67a99bd706bb467cf8682d344f91562fcaa3990ad779670b7381e3b2b5
@@ -1,10 +1,22 @@
1
1
  require "wes/data/api/model/base"
2
+ require "wes/data/api/model/creator_user"
2
3
 
3
4
  module Wes
4
5
  module Data
5
6
  module API
6
7
  module Model
7
8
  class Video < Base
9
+ def creator_user
10
+ route = [routes.video, id, routes.creator_user].join("/")
11
+ attributes = client.get(route).first
12
+ attributes.nil? ? nil
13
+ : Wes::Data::API::Model::CreatorUser.new(attributes)
14
+ end
15
+
16
+ def gif
17
+ @gif_state ||= video_state("gif", ".gif")
18
+ end
19
+
8
20
  def set_caption(edit)
9
21
  update(:caption => edit)
10
22
  end
@@ -17,11 +29,19 @@ module Wes
17
29
  @web_state ||= video_state("mp4", ".mp4")
18
30
  end
19
31
 
20
- def gif
21
- @gif_state ||= video_state("gif", ".gif")
32
+ private
33
+
34
+ def filename_hash
35
+ file_name.split(".").first
22
36
  end
23
37
 
24
- private
38
+ def filename_suffix
39
+ configuration.transcoded_video_filename_suffix
40
+ end
41
+
42
+ def generate_filename(suffix)
43
+ "#{filename_hash}/#{filename_suffix}#{suffix}"
44
+ end
25
45
 
26
46
  def update(changes)
27
47
  route = [routes.billing, id].join("/")
@@ -41,18 +61,6 @@ module Wes
41
61
  def video_transcoded?(video_state)
42
62
  video_state && video_state.state == "complete"
43
63
  end
44
-
45
- def generate_filename(suffix)
46
- "#{filename_hash}/#{filename_suffix}#{suffix}"
47
- end
48
-
49
- def filename_hash
50
- file_name.split(".").first
51
- end
52
-
53
- def filename_suffix
54
- configuration.transcoded_video_filename_suffix
55
- end
56
64
  end
57
65
  end
58
66
  end
data/lib/wes/data/api.rb CHANGED
@@ -5,7 +5,7 @@ require "wes/data/api/configuration"
5
5
  module Wes
6
6
  module Data
7
7
  module API
8
- VERSION = "5.4.0".freeze
8
+ VERSION = "5.5.0".freeze
9
9
  end
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wes-data-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.4.0
4
+ version: 5.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''