Class: AV
- Inherits:
-
Object
- Object
- AV
- Includes:
- UploadUtils
- Defined in:
- lib/filestack/models/filestack_av.rb
Overview
Class for AV objects – allows to check status and upgrade to filelink once completed
Instance Attribute Summary collapse
-
#apikey ⇒ Object
readonly
Returns the value of attribute apikey.
-
#security ⇒ Object
readonly
Returns the value of attribute security.
Instance Method Summary collapse
-
#initialize(url, apikey: nil, security: nil) ⇒ AV
constructor
A new instance of AV.
-
#status ⇒ String
Checks the status of the video conversion.
-
#to_filelink ⇒ Filestack::FilestackFilelink
Turns AV into filelink if video conversion is complete.
Methods included from UploadUtils
#get_url, #make_call, #send_upload
Constructor Details
#initialize(url, apikey: nil, security: nil) ⇒ AV
Returns a new instance of AV
10 11 12 13 14 |
# File 'lib/filestack/models/filestack_av.rb', line 10 def initialize(url, apikey: nil, security: nil) @url = url @apikey = apikey @security = security end |
Instance Attribute Details
#apikey ⇒ Object (readonly)
Returns the value of attribute apikey
8 9 10 |
# File 'lib/filestack/models/filestack_av.rb', line 8 def apikey @apikey end |
#security ⇒ Object (readonly)
Returns the value of attribute security
8 9 10 |
# File 'lib/filestack/models/filestack_av.rb', line 8 def security @security end |
Instance Method Details
#status ⇒ String
Checks the status of the video conversion
29 30 31 |
# File 'lib/filestack/models/filestack_av.rb', line 29 def status UploadUtils.make_call(@url, 'get').body['status'] end |
#to_filelink ⇒ Filestack::FilestackFilelink
Turns AV into filelink if video conversion is complete
19 20 21 22 23 24 |
# File 'lib/filestack/models/filestack_av.rb', line 19 def to_filelink return 'Video conversion incomplete' unless status == 'completed' response = UploadUtils.make_call(@url, 'get').body handle = response['data']['url'].split('/').last FilestackFilelink.new(handle, apikey: @apikey, security: @security) end |