Class: ZiggeoAudios
- Inherits:
-
Object
- Object
- ZiggeoAudios
- Defined in:
- lib/classes/ZiggeoAudios.rb
Instance Method Summary collapse
- #count(data = nil) ⇒ Object
- #create(data = nil, file = nil) ⇒ Object
- #delete(token_or_key) ⇒ Object
- #download_audio(token_or_key) ⇒ Object
- #get(token_or_key) ⇒ Object
- #get_bulk(data = nil) ⇒ Object
- #index(data = nil) ⇒ Object
-
#initialize(application) ⇒ ZiggeoAudios
constructor
A new instance of ZiggeoAudios.
- #update(token_or_key, data = nil) ⇒ Object
- #update_bulk(data = nil) ⇒ Object
Constructor Details
#initialize(application) ⇒ ZiggeoAudios
Returns a new instance of ZiggeoAudios.
3 4 5 |
# File 'lib/classes/ZiggeoAudios.rb', line 3 def initialize(application) @application = application end |
Instance Method Details
#count(data = nil) ⇒ Object
11 12 13 |
# File 'lib/classes/ZiggeoAudios.rb', line 11 def count(data = nil) return @application.api_connect.getJSON('/v1/audios/count', data) end |
#create(data = nil, file = nil) ⇒ Object
39 40 41 42 43 44 45 46 47 |
# File 'lib/classes/ZiggeoAudios.rb', line 39 def create(data = nil, file = nil) unless file.nil? result = @application.connect.postUploadJSON('/v1/audios-upload-url', 'audio', data, file, 'audio_type') result["default_stream"] = @application.connect.postJSON('/v1/audios/' + result["token"] + '/streams/' + result["default_stream"]["token"] + '/confirm-audio'); return result else return @application.api_connect.postJSON('/v1/audios/', data, file) end end |
#delete(token_or_key) ⇒ Object
35 36 37 |
# File 'lib/classes/ZiggeoAudios.rb', line 35 def delete(token_or_key) return @application.api_connect.delete('/v1/audios/' + token_or_key + '') end |
#download_audio(token_or_key) ⇒ Object
23 24 25 |
# File 'lib/classes/ZiggeoAudios.rb', line 23 def download_audio(token_or_key) return @application.js_cdn_connect.get('/v1/audios/' + token_or_key + '/audio') end |
#get(token_or_key) ⇒ Object
15 16 17 |
# File 'lib/classes/ZiggeoAudios.rb', line 15 def get(token_or_key) return @application.api_connect.getJSON('/v1/audios/' + token_or_key + '') end |
#get_bulk(data = nil) ⇒ Object
19 20 21 |
# File 'lib/classes/ZiggeoAudios.rb', line 19 def get_bulk(data = nil) return @application.api_connect.postJSON('/v1/audios/get-bulk', data) end |
#index(data = nil) ⇒ Object
7 8 9 |
# File 'lib/classes/ZiggeoAudios.rb', line 7 def index(data = nil) return @application.api_connect.getJSON('/v1/audios/', data) end |
#update(token_or_key, data = nil) ⇒ Object
27 28 29 |
# File 'lib/classes/ZiggeoAudios.rb', line 27 def update(token_or_key, data = nil) return @application.api_connect.postJSON('/v1/audios/' + token_or_key + '', data) end |
#update_bulk(data = nil) ⇒ Object
31 32 33 |
# File 'lib/classes/ZiggeoAudios.rb', line 31 def update_bulk(data = nil) return @application.api_connect.postJSON('/v1/audios/update-bulk', data) end |