Class: Panda::Encoding

Inherits:
Resource show all
Includes:
ShortStatus
Defined in:
lib/panda/resources/encoding.rb

Constant Summary

Constants included from Router

Router::DEFAULT_FORMAT, Router::VAR_PATTERN

Instance Attribute Summary

Attributes inherited from Base

#attributes, #errors

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ShortStatus

#fail?, #processing?, #success?

Methods inherited from Resource

#cloud, cloud, #create, #create!, #initialize, method_missing, #reload

Methods included from CloudConnection

#connection

Methods included from Finders::FindMany

#all, #find_by

Methods included from Associations

included

Methods included from Builders

included

Methods inherited from Base

#changed?, #delete, id, #id, #id=, #initialize, #new?, #reload, sti_name, #to_json

Methods included from Router

included, #object_url_map

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

.firstObject



9
10
11
# File 'lib/panda/resources/encoding.rb', line 9

def first
  EncodingScope.new(self).per_page(1).first
end

Instance Method Details

#error_logObject



18
19
20
# File 'lib/panda/resources/encoding.rb', line 18

def error_log
  get_url(".log") if fail?
end

#screenshotsObject



22
23
24
# File 'lib/panda/resources/encoding.rb', line 22

def screenshots
  ((1..7).map{|i| get_url("_#{i}.jpg")} if success?) || []
end

#urlObject



14
15
16
# File 'lib/panda/resources/encoding.rb', line 14

def url
  get_url("#{extname}")
end