Class: FormatParser::Video

Inherits:
Object
  • Object
show all
Includes:
AttributesJSON
Defined in:
lib/video.rb

Constant Summary collapse

NATURE =
:video

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AttributesJSON

#as_json, #to_json

Constructor Details

#initialize(**attributes) ⇒ Video

Only permits assignments via defined accessors



27
28
29
# File 'lib/video.rb', line 27

def initialize(**attributes)
  attributes.map { |(k, v)| public_send("#{k}=", v) }
end

Instance Attribute Details

#formatObject

Type of the file (e.g :mp3)



12
13
14
# File 'lib/video.rb', line 12

def format
  @format
end

#height_pxObject

Returns the value of attribute height_px.



9
10
11
# File 'lib/video.rb', line 9

def height_px
  @height_px
end

#intrinsicsObject

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_framesObject

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_secondsObject

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_pxObject

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

#natureObject



31
32
33
# File 'lib/video.rb', line 31

def nature
  NATURE
end