Sha256: f05721b88ad14832fc5230dc576e98946848c799da5dbe37570b4842e6d37b2d
Contents?: true
Size: 885 Bytes
Versions: 67
Compression:
Stored size: 885 Bytes
Contents
# frozen_string_literal: true require "attr_extras" module Renalware # A base class for Summary presenters in other name-spaces. SummaryParts can be composed into # reporting dashboards or summary pages. The Clinical Summary for instance comprises an array # of various SummaryParts class SummaryPart DATE_FORMAT = "%Y%m%d%H%M%S%L" rattr_initialize :patient, :current_user attr_implement :to_partial_path # If the subclass defines a cache_key Rails will cache the partial def cache_key nil end def render? true end def cache? cache_key.present? end protected def date_formatted_for_cache(date) date&.strftime(DATE_FORMAT) end def title_friendly_collection_count(actual:, total:) if total > actual "#{actual} of #{total}" else actual end end end end
Version data entries
67 entries across 67 versions & 1 rubygems