Class: IIIF::Image::Size::BestFit
- Inherits:
-
Object
- Object
- IIIF::Image::Size::BestFit
- Defined in:
- lib/iiif/image/size/best_fit.rb
Overview
The image content is scaled for the best fit such that the resulting width and height are less than or equal to the requested width and height.
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(width, height) ⇒ BestFit
constructor
A new instance of BestFit.
- #to_s ⇒ Object
Constructor Details
#initialize(width, height) ⇒ BestFit
Returns a new instance of BestFit.
8 9 10 11 |
# File 'lib/iiif/image/size/best_fit.rb', line 8 def initialize(width, height) @width = width @height = height end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
13 14 15 |
# File 'lib/iiif/image/size/best_fit.rb', line 13 def height @height end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
13 14 15 |
# File 'lib/iiif/image/size/best_fit.rb', line 13 def width @width end |
Instance Method Details
#to_s ⇒ Object
15 16 17 |
# File 'lib/iiif/image/size/best_fit.rb', line 15 def to_s "!#{width},#{height}" end |