Module: Ccls::Assertions
- Defined in:
- lib/ccls_engine/assertions.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
- #assert_subject_is_eligible(study_subject) ⇒ Object (also: #assert_study_subject_is_eligible)
- #assert_subject_is_not_eligible(study_subject) ⇒ Object (also: #assert_study_subject_is_not_eligible)
Class Method Details
.included(base) ⇒ Object
3 4 5 |
# File 'lib/ccls_engine/assertions.rb', line 3 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#assert_subject_is_eligible(study_subject) ⇒ Object Also known as: assert_study_subject_is_eligible
7 8 9 10 11 12 |
# File 'lib/ccls_engine/assertions.rb', line 7 def assert_subject_is_eligible(study_subject) hxe = study_subject.enrollments.find_by_project_id(Project['HomeExposures'].id) assert_not_nil hxe assert_nil hxe.ineligible_reason_id assert_equal hxe.is_eligible, YNDK[:yes] end |
#assert_subject_is_not_eligible(study_subject) ⇒ Object Also known as: assert_study_subject_is_not_eligible
15 16 17 18 19 20 |
# File 'lib/ccls_engine/assertions.rb', line 15 def assert_subject_is_not_eligible(study_subject) hxe = study_subject.enrollments.find_by_project_id(Project['HomeExposures'].id) assert_not_nil hxe assert_not_nil hxe.ineligible_reason_id assert_equal hxe.is_eligible, YNDK[:no] end |