Class: Renalware::Clinical::DryWeightsPresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/renalware/clinical/dry_weights_presenter.rb

Constant Summary collapse

DEFAULT_LIMIT =
10_000

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(patient:, dry_weights: nil, limit: nil) ⇒ DryWeightsPresenter

Returns a new instance of DryWeightsPresenter.



11
12
13
14
15
# File 'app/presenters/renalware/clinical/dry_weights_presenter.rb', line 11

def initialize(patient:, dry_weights: nil, limit: nil)
  @patient = patient
  @limit = limit || DEFAULT_LIMIT
  @weights = dry_weights # optional otherwise we grab them ourselves
end

Instance Attribute Details

#limitObject (readonly)

Returns the value of attribute limit.



9
10
11
# File 'app/presenters/renalware/clinical/dry_weights_presenter.rb', line 9

def limit
  @limit
end

#patientObject (readonly)

Returns the value of attribute patient.



9
10
11
# File 'app/presenters/renalware/clinical/dry_weights_presenter.rb', line 9

def patient
  @patient
end

Instance Method Details

#dry_weightsObject



17
18
19
20
21
22
23
24
# File 'app/presenters/renalware/clinical/dry_weights_presenter.rb', line 17

def dry_weights
  @dry_weights ||= begin
    CollectionPresenter.new(
      weights,
      Renalware::Clinical::DryWeightPresenter
    )
  end
end