Class: PoliPage::ThumbnailOptions
- Inherits:
-
Data
- Object
- Data
- PoliPage::ThumbnailOptions
- Defined in:
- lib/poli_page/inputs/thumbnail_options.rb
Overview
Convenience value-object form of the ‘client.documents.thumbnails` options hash. Methods accept bare kwargs directly; this wrapper is for callers who want `Data.define`’s equality + frozen-by-default semantics.
-
‘width` [Integer] thumbnail width in pixels (required)
-
‘format` [“png”, “jpeg”, nil] output format; default “png”
-
‘quality` [Integer, nil] JPEG quality 1-100; only valid when format is “jpeg”
-
‘pages` [Array<Integer>, nil] 1-based page indices to render; nil means all pages
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#pages ⇒ Object
readonly
Returns the value of attribute pages.
-
#quality ⇒ Object
readonly
Returns the value of attribute quality.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format
12 13 14 |
# File 'lib/poli_page/inputs/thumbnail_options.rb', line 12 def format @format end |
#pages ⇒ Object (readonly)
Returns the value of attribute pages
12 13 14 |
# File 'lib/poli_page/inputs/thumbnail_options.rb', line 12 def pages @pages end |
#quality ⇒ Object (readonly)
Returns the value of attribute quality
12 13 14 |
# File 'lib/poli_page/inputs/thumbnail_options.rb', line 12 def quality @quality end |
#width ⇒ Object (readonly)
Returns the value of attribute width
12 13 14 |
# File 'lib/poli_page/inputs/thumbnail_options.rb', line 12 def width @width end |
Class Method Details
._strict_new ⇒ Object
19 |
# File 'lib/poli_page/inputs/thumbnail_options.rb', line 19 alias _strict_new new |
.new(width:, format: nil, quality: nil, pages: nil) ⇒ Object
21 22 23 |
# File 'lib/poli_page/inputs/thumbnail_options.rb', line 21 def new(width:, format: nil, quality: nil, pages: nil) _strict_new(width: width, format: format, quality: quality, pages: pages) end |
Instance Method Details
#to_h ⇒ Object
13 14 15 |
# File 'lib/poli_page/inputs/thumbnail_options.rb', line 13 def to_h super.compact end |