Sha256: 0600c1d0cebccaee3c999f8d0c85d7ec29eb49bdb56b0984fdfd74c6fba18d1f
Contents?: true
Size: 867 Bytes
Versions: 98
Compression:
Stored size: 867 Bytes
Contents
# frozen_string_literal: true require_dependency "renalware/clinical" module Renalware module Clinical class DryWeightsPresenter DEFAULT_LIMIT = 10_000 attr_reader :patient, :limit def initialize(patient:, dry_weights: nil, limit: nil) @patient = patient @limit = limit || DEFAULT_LIMIT @weights = dry_weights # optional otherwise we grab them ourselves end def dry_weights @dry_weights ||= begin CollectionPresenter.new( weights, Renalware::Clinical::DryWeightPresenter ) end end private def weights @weights ||= begin Renalware::Clinical::DryWeight .for_patient(patient) .includes(:assessor) .limit(limit) .ordered end end end end end
Version data entries
98 entries across 98 versions & 1 rubygems