Class: Vzaar::Api
- Inherits:
-
Struct
- Object
- Struct
- Vzaar::Api
- Defined in:
- lib/vzaar/api.rb
Instance Attribute Summary collapse
-
#conn ⇒ Object
Returns the value of attribute conn.
Instance Method Summary collapse
- #account_type(account_type_id, opts = {}) ⇒ Object
- #add_subtitle(video_id, opts = {}) ⇒ Object
- #delete_video(video_id, opts = {}) ⇒ Object
- #edit_video(video_id, opts = {}) ⇒ Object
- #generate_thumbnail(video_id, opts = {}) ⇒ Object
- #link_upload(url, opts = {}) ⇒ Object
- #process_video(opts = {}) ⇒ Object
- #signature(opts = {}) ⇒ Object
- #upload_thumbnail(video_id, opts = {}) ⇒ Object
- #upload_video(opts = {}) ⇒ Object
- #user_details(login, opts = {}) ⇒ Object
- #video_details(video_id, opts = {}) ⇒ Object
- #video_list(login, opts = {}) ⇒ Object
- #videos(opts = {}) ⇒ Object
- #whoami(opts = {}) ⇒ Object
Instance Attribute Details
#conn ⇒ Object
Returns the value of attribute conn
2 3 4 |
# File 'lib/vzaar/api.rb', line 2 def conn @conn end |
Instance Method Details
#account_type(account_type_id, opts = {}) ⇒ Object
9 10 11 12 |
# File 'lib/vzaar/api.rb', line 9 def account_type(account_type_id, opts={}) _opts = opts.merge(account_type_id: account_type_id) Request::AccountType.new(conn, _opts).execute end |
#add_subtitle(video_id, opts = {}) ⇒ Object
53 54 55 |
# File 'lib/vzaar/api.rb', line 53 def add_subtitle(video_id, opts={}) Request::AddSubtitle.new(conn, opts.merge(video_id: video_id)).execute end |
#delete_video(video_id, opts = {}) ⇒ Object
30 31 32 |
# File 'lib/vzaar/api.rb', line 30 def delete_video(video_id, opts={}) Request::DeleteVideo.new(conn, opts.merge(video_id: video_id)).execute end |
#edit_video(video_id, opts = {}) ⇒ Object
34 35 36 |
# File 'lib/vzaar/api.rb', line 34 def edit_video(video_id, opts={}) Request::EditVideo.new(conn, opts.merge(video_id: video_id)).execute end |
#generate_thumbnail(video_id, opts = {}) ⇒ Object
61 62 63 |
# File 'lib/vzaar/api.rb', line 61 def generate_thumbnail(video_id, opts={}) Request::GenerateThumbnail.new(conn, opts.merge(video_id: video_id)).execute end |
#link_upload(url, opts = {}) ⇒ Object
65 66 67 68 69 |
# File 'lib/vzaar/api.rb', line 65 def link_upload(url, opts={}) sig = signature _opts = opts.merge({ guid: sig.guid, key: sig.key, url: url }) Request::LinkUpload.new(conn, _opts).execute end |
#process_video(opts = {}) ⇒ Object
42 43 44 |
# File 'lib/vzaar/api.rb', line 42 def process_video(opts={}) Request::ProcessVideo.new(conn, opts).execute end |
#signature(opts = {}) ⇒ Object
38 39 40 |
# File 'lib/vzaar/api.rb', line 38 def signature(opts={}) Request::Signature.new(conn, opts).execute end |
#upload_thumbnail(video_id, opts = {}) ⇒ Object
57 58 59 |
# File 'lib/vzaar/api.rb', line 57 def upload_thumbnail(video_id, opts={}) Request::UploadThumbnail.new(conn, opts.merge(video_id: video_id)).execute end |
#upload_video(opts = {}) ⇒ Object
46 47 48 49 50 51 |
# File 'lib/vzaar/api.rb', line 46 def upload_video(opts={}) uploader = Uploader.new(conn, signature, opts) uploader.upload do |u| process_video(u.processing_params) end end |
#user_details(login, opts = {}) ⇒ Object
14 15 16 |
# File 'lib/vzaar/api.rb', line 14 def user_details(login, opts={}) Request::UserDetails.new(conn, opts.merge(login: login)).execute end |
#video_details(video_id, opts = {}) ⇒ Object
18 19 20 |
# File 'lib/vzaar/api.rb', line 18 def video_details(video_id, opts={}) Request::VideoDetails.new(conn, opts.merge(video_id: video_id)).execute end |
#video_list(login, opts = {}) ⇒ Object
22 23 24 |
# File 'lib/vzaar/api.rb', line 22 def video_list(login, opts={}) Request::VideoList.new(conn, opts.merge(login: login)).execute end |
#videos(opts = {}) ⇒ Object
26 27 28 |
# File 'lib/vzaar/api.rb', line 26 def videos(opts={}) video_list(conn.login, { authenticated: true, page: opts[:page] }) end |