Class: HLS::ApplicationVideo::PosterDeclaration
- Inherits:
-
Data
- Object
- Data
- HLS::ApplicationVideo::PosterDeclaration
- Defined in:
- lib/hls/application_video.rb
Overview
A poster declaration. Resolved against an input at instance time to a concrete dimension pair. Filename is ‘<name>.jpg`.
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#scale ⇒ Object
readonly
Returns the value of attribute scale.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height
72 73 74 |
# File 'lib/hls/application_video.rb', line 72 def height @height end |
#name ⇒ Object (readonly)
Returns the value of attribute name
72 73 74 |
# File 'lib/hls/application_video.rb', line 72 def name @name end |
#scale ⇒ Object (readonly)
Returns the value of attribute scale
72 73 74 |
# File 'lib/hls/application_video.rb', line 72 def scale @scale end |
#width ⇒ Object (readonly)
Returns the value of attribute width
72 73 74 |
# File 'lib/hls/application_video.rb', line 72 def width @width end |
Instance Method Details
#filename ⇒ Object
73 74 75 |
# File 'lib/hls/application_video.rb', line 73 def filename "#{name}.jpg" end |
#resolve(input:) ⇒ Object
77 78 79 80 81 82 83 84 85 |
# File 'lib/hls/application_video.rb', line 77 def resolve(input:) if scale w = (input.width * scale).floor h = (input.height * scale).floor [w, h] else [width, height] end end |