Class: Thumbnailer::Maker
- Inherits:
-
Object
- Object
- Thumbnailer::Maker
- Defined in:
- lib/thumbnailer.rb
Instance Method Summary collapse
-
#initialize(file_path, mimetype, params = {}) ⇒ Maker
constructor
A new instance of Maker.
- #thumbnail ⇒ Object
Constructor Details
#initialize(file_path, mimetype, params = {}) ⇒ Maker
Returns a new instance of Maker.
14 15 16 17 18 19 20 21 |
# File 'lib/thumbnailer.rb', line 14 def initialize(file_path, mimetype, params = {}) params = {width: 181, height: 256, string: false}.merge params @file_path = file_path @mimetype = mimetype @width = params[:width] @height = params[:height] @return_string = params[:string] end |
Instance Method Details
#thumbnail ⇒ Object
23 24 25 26 |
# File 'lib/thumbnailer.rb', line 23 def thumbnail return odt_thumbnail if @mimetype =~ /opendocument.text/ return pdf_thumbnail if @mimetype =~ /pdf/ end |