Sha256: 4245bca5e890603d61fcaec63f9dc2b17396d069d4f9e030aef36212a7c6bff5
Contents?: true
Size: 655 Bytes
Versions: 16
Compression:
Stored size: 655 Bytes
Contents
# frozen_string_literal: true module Lcms module Engine class GenericPresenter < Lcms::Engine::ResourcePresenter def generic_title "#{subject.try(:upcase)} #{grades.to_str}" end def type_name I18n.t("resource_types.#{resource_type}") end def preview? downloads.any? { |d| d.main? && d.attachment_content_type == 'pdf' && RestClient.head(d.attachment_url) } rescue RestClient::ExceptionWithResponse false end def pdf_preview_download resource_downloads.find { |d| d.download.main? && d.download.attachment_content_type == 'pdf' } end end end end
Version data entries
16 entries across 16 versions & 1 rubygems