Class: Renalware::YearDatedConfirmation

Inherits:
NestedAttribute show all
Defined in:
app/documents/renalware/year_dated_confirmation.rb

Direct Known Subclasses

YearDatedDiagnosis

Constant Summary

Constants inherited from Document::Embedded

Document::Embedded::STRIPPABLE_TYPES

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from NestedAttribute

#nested_attribute?, #to_partial_path

Methods inherited from Document::Embedded

attribute, attributes_list, #method_missing, old_attribute, old_attributes, #strip_leading_trailing_whitespace_from_numbers

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Document::Embedded

Class Method Details

.valid_yearsObject



12
13
14
# File 'app/documents/renalware/year_dated_confirmation.rb', line 12

def self.valid_years
  (1900..Time.zone.today.year).to_a
end

Instance Method Details

#to_sObject



16
17
18
19
# File 'app/documents/renalware/year_dated_confirmation.rb', line 16

def to_s
  datestamp = confirmed_on_year.present? ? "(#{confirmed_on_year})" : nil
  [status&.text, datestamp].compact.join(" ")
end