Class: Renalware::Clinical::DryWeightsPresenter
- Inherits:
-
Object
- Object
- Renalware::Clinical::DryWeightsPresenter
- Defined in:
- app/presenters/renalware/clinical/dry_weights_presenter.rb
Constant Summary collapse
- DEFAULT_LIMIT =
10_000
Instance Attribute Summary collapse
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#patient ⇒ Object
readonly
Returns the value of attribute patient.
Instance Method Summary collapse
- #dry_weights ⇒ Object
-
#initialize(patient:, dry_weights: nil, limit: nil) ⇒ DryWeightsPresenter
constructor
A new instance of DryWeightsPresenter.
- #weights ⇒ Object
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
#limit ⇒ Object (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 |
#patient ⇒ Object (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_weights ⇒ Object
26 27 28 29 30 |
# File 'app/presenters/renalware/clinical/dry_weights_presenter.rb', line 26 def dry_weights @dry_weights ||= begin CollectionPresenter.new(weights, Renalware::Clinical::DryWeightPresenter) end end |