Sha256: 87a059e3ac708f414266225f872c47cb0b460bd9e049d2dbc56b1f0ad4063ae4
Contents?: true
Size: 522 Bytes
Versions: 27
Compression:
Stored size: 522 Bytes
Contents
require "document/enum" module Renalware class YearDatedConfirmation < NestedAttribute attribute :status, Document::Enum, enums: %i(yes no unknown) attribute :confirmed_on_year, Integer validates :confirmed_on_year, numericality: { allow_blank: true, only_integer: true } def self.valid_years (1900..Time.zone.today.year).to_a end def to_s datestamp = confirmed_on_year.present? ? "(#{confirmed_on_year})" : nil [status&.text, datestamp].compact.join(" ") end end end
Version data entries
27 entries across 27 versions & 1 rubygems