Class: Ari::Playback
- Defined in:
- lib/ari/resources/playback.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#media_uri ⇒ Object
readonly
Returns the value of attribute media_uri.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#target_uri ⇒ Object
readonly
Returns the value of attribute target_uri.
Class Method Summary collapse
-
.control(options = {}) ⇒ Object
POST /playbacks/%playbackId/control.
-
.get(options = {}) ⇒ Object
GET /playbacks/%playbackId.
-
.stop(options = {}) ⇒ Object
DELETE /playbacks/%playbackId.
Instance Method Summary collapse
Methods inherited from Resource
#add_listener, client, #client, #remove_all_listeners!, #remove_listener
Methods inherited from Model
Constructor Details
This class inherits a constructor from Ari::Model
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
15 16 17 |
# File 'lib/ari/resources/playback.rb', line 15 def id @id end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
15 16 17 |
# File 'lib/ari/resources/playback.rb', line 15 def language @language end |
#media_uri ⇒ Object (readonly)
Returns the value of attribute media_uri.
15 16 17 |
# File 'lib/ari/resources/playback.rb', line 15 def media_uri @media_uri end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
15 16 17 |
# File 'lib/ari/resources/playback.rb', line 15 def state @state end |
#target_uri ⇒ Object (readonly)
Returns the value of attribute target_uri.
15 16 17 |
# File 'lib/ari/resources/playback.rb', line 15 def target_uri @target_uri end |
Class Method Details
.control(options = {}) ⇒ Object
POST /playbacks/%playbackId/control
Control object for a playback operation.
Parameters:
playbackId (required) - Playback’s id operation (required) - Operation to perform on the playback.
69 70 71 72 73 74 |
# File 'lib/ari/resources/playback.rb', line 69 def self.control( = {}) raise ArgumentError.new("Parameter playbackId must be passed in options hash.") unless [:playbackId] raise ArgumentError.new("Parameter operation must be passed in options hash.") unless [:operation] path = '/playbacks/%{playbackId}/control' % response = client().post(path, ) end |
.get(options = {}) ⇒ Object
GET /playbacks/%playbackId
Control object for a playback operation.
Parameters:
playbackId (required) - Playback’s id
27 28 29 30 31 32 |
# File 'lib/ari/resources/playback.rb', line 27 def self.get( = {}) raise ArgumentError.new("Parameter playbackId must be passed in options hash.") unless [:playbackId] path = '/playbacks/%{playbackId}' % response = client().get(path, ) Playback.new(response.merge(client: [:client])) end |
.stop(options = {}) ⇒ Object
DELETE /playbacks/%playbackId
Control object for a playback operation.
Parameters:
playbackId (required) - Playback’s id
47 48 49 50 51 52 53 |
# File 'lib/ari/resources/playback.rb', line 47 def self.stop( = {}) raise ArgumentError.new("Parameter playbackId must be passed in options hash.") unless [:playbackId] path = '/playbacks/%{playbackId}' % response = client().delete(path, ) rescue Ari::RequestError => e raise unless e.code == '404' end |
Instance Method Details
#control(options = {}) ⇒ Object
76 77 78 |
# File 'lib/ari/resources/playback.rb', line 76 def control( = {}) self.class.control(.merge(playbackId: self.id, client: @client)) end |
#get(options = {}) ⇒ Object
34 35 36 |
# File 'lib/ari/resources/playback.rb', line 34 def get( = {}) self.class.get(.merge(playbackId: self.id, client: @client)) end |
#stop(options = {}) ⇒ Object
55 56 57 |
# File 'lib/ari/resources/playback.rb', line 55 def stop( = {}) self.class.stop(.merge(playbackId: self.id, client: @client)) end |