lib/admission.rb
15 lines · ruby
Project files
# frozen_string_literal: true
Admission = Data.define(:reasons) do
def initialize(reasons:)
super(reasons: reasons.dup.freeze)
end
def admitted?
reasons.empty?
end
def rejected?
!admitted?
end
end
Read along in the manual: The Reloading Lab · Download the project (zip)