Class: Ddr::Derivatives::Thumbnail

Inherits:
Derivative show all
Defined in:
lib/ddr/derivatives/thumbnail.rb

Instance Attribute Summary

Attributes inherited from Derivative

#generator, #workdir

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Derivative

#generate!, #initialize

Constructor Details

This class inherits a constructor from Ddr::Derivatives::Derivative

Class Method Details

.generatable?(object) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/ddr/derivatives/thumbnail.rb', line 4

def self.generatable?(object)
  object.can_have_thumbnail? && object.has_content? && object.image?
end

.has_derivative?(object) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/ddr/derivatives/thumbnail.rb', line 8

def self.has_derivative?(object)
  object.has_thumbnail?
end

Instance Method Details

#delete!(object) ⇒ Object



12
13
14
15
# File 'lib/ddr/derivatives/thumbnail.rb', line 12

def delete!(object)
  object.thumbnail.content = ''
  object.save
end