Class: Animoto::Manifests::DirectingAndRendering
- Defined in:
- lib/animoto/manifests/directing_and_rendering.rb
Overview
A directing-and-rendering manifest is little more than just a single envelope with a directing manifest and a rendering manifest embedded within.
Instance Attribute Summary collapse
-
#directing_manifest ⇒ Manifests::Directing
readonly
The embedded directing manifest.
-
#rendering_manifest ⇒ Manifests::Rendering
readonly
The embedded rendering manifest.
Attributes inherited from Base
#http_callback_format, #http_callback_url, #partner_metadata
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Manifests::DirectingAndRendering
constructor
Creates a new directing-and-rendering manifest.
-
#method_missing(*args) ⇒ Object
Delegates method calls to the underlying directing or rendering manifests if they respond to the call.
-
#to_hash(options = {}) ⇒ Hash{String=>Object}
Returns a representation of this manifest as a Hash.
Methods inherited from Base
#associated_job_class, associated_job_class, infer_content_type
Methods included from Support::ContentType
Constructor Details
#initialize(options = {}) ⇒ Manifests::DirectingAndRendering
Creates a new directing-and-rendering manifest.
27 28 29 30 31 |
# File 'lib/animoto/manifests/directing_and_rendering.rb', line 27 def initialize = {} super @directing_manifest = Manifests::Directing.new(.only(:title, :pacing, :max_duration, :style, :postroll)) @rendering_manifest = Manifests::Rendering.new(.only(:resolution, :framerate, :format)) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args) ⇒ Object
Delegates method calls to the underlying directing or rendering manifests if they respond to the call.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/animoto/manifests/directing_and_rendering.rb', line 37 def method_missing *args name = args.first if directing_manifest.respond_to?(name) directing_manifest.__send__(*args) elsif rendering_manifest.respond_to?(name) rendering_manifest.__send__(*args) else super end end |
Instance Attribute Details
#directing_manifest ⇒ Manifests::Directing (readonly)
The embedded directing manifest
10 11 12 |
# File 'lib/animoto/manifests/directing_and_rendering.rb', line 10 def directing_manifest @directing_manifest end |
#rendering_manifest ⇒ Manifests::Rendering (readonly)
The embedded rendering manifest
14 15 16 |
# File 'lib/animoto/manifests/directing_and_rendering.rb', line 14 def rendering_manifest @rendering_manifest end |
Instance Method Details
#to_hash(options = {}) ⇒ Hash{String=>Object}
Returns a representation of this manifest as a Hash.
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/animoto/manifests/directing_and_rendering.rb', line 54 def to_hash = {} hash = { 'directing_and_rendering_job' => {} } job = hash['directing_and_rendering_job'] add_callback_information job job job['directing_manifest'] = self.directing_manifest.to_hash['directing_job']['directing_manifest'] job['rendering_manifest'] = self.rendering_manifest.to_hash['rendering_job']['rendering_manifest'] hash end |