Class: AnimateIt::PlayerManifest
- Inherits:
-
Object
- Object
- AnimateIt::PlayerManifest
- Defined in:
- lib/animate_it/player_manifest.rb
Constant Summary collapse
- VERSION =
1
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(composition) ⇒ PlayerManifest
constructor
A new instance of PlayerManifest.
Constructor Details
#initialize(composition) ⇒ PlayerManifest
Returns a new instance of PlayerManifest.
5 6 7 |
# File 'lib/animate_it/player_manifest.rb', line 5 def initialize(composition) @composition = composition end |
Instance Method Details
#as_json ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/animate_it/player_manifest.rb', line 9 def as_json(*) @composition.chapters.validate! { "version" => VERSION, "id" => @composition.id, "width" => @composition.width, "height" => @composition.height, "fps" => @composition.fps, "duration" => @composition.duration_in_frames, "chapters" => @composition.chapters.as_json, "playback" => @composition..transform_keys { |key| camelize(key) } } end |