Class: Helios::Press::BlockImage

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/helios/press/block_image.rb

Constant Summary collapse

DOCUMENT_CONTENT_TYPES =
%w[
  application/pdf
  application/msword
  application/vnd.openxmlformats-officedocument.wordprocessingml.document
].freeze

Instance Method Summary collapse

Instance Method Details

#document?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'app/models/helios/press/block_image.rb', line 25

def document?
  file.attached? && DOCUMENT_CONTENT_TYPES.include?(file.content_type)
end

#svg?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'app/models/helios/press/block_image.rb', line 21

def svg?
  file.attached? && file.content_type == "image/svg+xml"
end

#variable?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'app/models/helios/press/block_image.rb', line 29

def variable?
  file.attached? && file.variable?
end