Class: FormatParser::Video
- Inherits:
-
Object
- Object
- FormatParser::Video
- Includes:
- AttributesJSON
- Defined in:
- lib/video.rb
Constant Summary collapse
- NATURE =
:video
Constants included from AttributesJSON
AttributesJSON::MAXIMUM_JSON_NESTING_WHEN_SANITIZING
Instance Attribute Summary collapse
-
#content_type ⇒ Object
The MIME type of the video.
-
#format ⇒ Object
Type of the file (e.g :mp3).
-
#height_px ⇒ Object
Returns the value of attribute height_px.
-
#intrinsics ⇒ Object
If a parser wants to provide any extra information to the caller it can be placed here.
-
#media_duration_frames ⇒ Object
Duration of the media object in addressable frames or samples, as an Integer.
-
#media_duration_seconds ⇒ Object
Duration of the media object (be it audio or video) in seconds, as a Float.
-
#width_px ⇒ Object
Returns the value of attribute width_px.
Instance Method Summary collapse
-
#initialize(**attributes) ⇒ Video
constructor
Only permits assignments via defined accessors.
- #nature ⇒ Object
Methods included from AttributesJSON
_sanitize_json_value, #as_json, #to_json
Constructor Details
#initialize(**attributes) ⇒ Video
Only permits assignments via defined accessors
30 31 32 |
# File 'lib/video.rb', line 30 def initialize(**attributes) attributes.map { |(k, v)| public_send("#{k}=", v) } end |
Instance Attribute Details
#content_type ⇒ Object
The MIME type of the video
27 28 29 |
# File 'lib/video.rb', line 27 def content_type @content_type end |
#format ⇒ Object
Type of the file (e.g :mp3)
12 13 14 |
# File 'lib/video.rb', line 12 def format @format end |
#height_px ⇒ Object
Returns the value of attribute height_px.
9 10 11 |
# File 'lib/video.rb', line 9 def height_px @height_px end |
#intrinsics ⇒ Object
If a parser wants to provide any extra information to the caller it can be placed here
24 25 26 |
# File 'lib/video.rb', line 24 def intrinsics @intrinsics end |
#media_duration_frames ⇒ Object
Duration of the media object in addressable frames or samples, as an Integer
20 21 22 |
# File 'lib/video.rb', line 20 def media_duration_frames @media_duration_frames end |
#media_duration_seconds ⇒ Object
Duration of the media object (be it audio or video) in seconds, as a Float
16 17 18 |
# File 'lib/video.rb', line 16 def media_duration_seconds @media_duration_seconds end |
#width_px ⇒ Object
Returns the value of attribute width_px.
7 8 9 |
# File 'lib/video.rb', line 7 def width_px @width_px end |
Instance Method Details
#nature ⇒ Object
34 35 36 |
# File 'lib/video.rb', line 34 def nature NATURE end |