Class: Panda::Encoding
- Includes:
- VideoState
- Defined in:
- lib/panda/resources/encoding.rb
Constant Summary
Constants included from Router
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
- #cancel ⇒ Object
- #retry ⇒ Object
- #screenshots(options = {}) ⇒ Object
- #url(options = {}) ⇒ Object
- #urls(options = {}) ⇒ Object
Methods included from VideoState
#fail?, #processing?, #success?
Methods inherited from Resource
#cloud, cloud, #initialize, method_missing, #reload
Methods included from CloudConnection
Methods included from Associations
Methods included from Destroyers
Methods inherited from Base
#changed?, #id, #id=, #initialize, #inspect, #new?, #reload, sti_name, #to_json
Methods included from Finders
Methods included from Builders
Methods included from Router
included, #replace_pattern_with_self_variables
Constructor Details
This class inherits a constructor from Panda::Resource
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Panda::Base
Class Method Details
.first ⇒ Object
9 10 11 |
# File 'lib/panda/resources/encoding.rb', line 9 def first EncodingScope.new(self).per_page(1).first end |
Instance Method Details
#cancel ⇒ Object
33 34 35 |
# File 'lib/panda/resources/encoding.rb', line 33 def cancel connection.post("/encodings/#{id}/cancel.json")['canceled'] end |
#retry ⇒ Object
37 38 39 |
# File 'lib/panda/resources/encoding.rb', line 37 def retry connection.post("/encodings/#{id}/retry.json")['retried'] end |
#screenshots(options = {}) ⇒ Object
27 28 29 30 31 |
# File 'lib/panda/resources/encoding.rb', line 27 def screenshots(={}) = {:https => false} = .merge() ((1..7).map{|i| get_url("#{path}_#{i}.jpg", [:https])} if success?) || [] end |
#url(options = {}) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/panda/resources/encoding.rb', line 14 def url(={}) = {:https => false} = .merge() full_path = "#{path}#{extname}" get_url(full_path, [:https]) if files.include?(full_path) end |
#urls(options = {}) ⇒ Object
21 22 23 24 25 |
# File 'lib/panda/resources/encoding.rb', line 21 def urls(={}) = {:https => false} = .merge() files.map {|f| get_url(f, [:https])} end |