Class: Renalware::Patients::MDMListQuery
- Inherits:
-
Object
- Object
- Renalware::Patients::MDMListQuery
- Defined in:
- app/models/renalware/patients/mdm_list_query.rb
Defined Under Namespace
Modules: Scopes
Instance Attribute Summary collapse
-
#modality ⇒ Object
readonly
Returns the value of attribute modality.
-
#q ⇒ Object
readonly
Returns the value of attribute q.
-
#relation ⇒ Object
readonly
Returns the value of attribute relation.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(relation:, modality:, q: nil) ⇒ MDMListQuery
constructor
A new instance of MDMListQuery.
- #search ⇒ Object
Constructor Details
#initialize(relation:, modality:, q: nil) ⇒ MDMListQuery
Returns a new instance of MDMListQuery.
8 9 10 11 12 |
# File 'app/models/renalware/patients/mdm_list_query.rb', line 8 def initialize(relation:, modality:, q: nil) @relation = relation @modality = modality @q = q || {} end |
Instance Attribute Details
#modality ⇒ Object (readonly)
Returns the value of attribute modality.
6 7 8 |
# File 'app/models/renalware/patients/mdm_list_query.rb', line 6 def modality @modality end |
#q ⇒ Object (readonly)
Returns the value of attribute q.
6 7 8 |
# File 'app/models/renalware/patients/mdm_list_query.rb', line 6 def q @q end |
#relation ⇒ Object (readonly)
Returns the value of attribute relation.
6 7 8 |
# File 'app/models/renalware/patients/mdm_list_query.rb', line 6 def relation @relation end |
Instance Method Details
#call ⇒ Object
14 15 16 |
# File 'app/models/renalware/patients/mdm_list_query.rb', line 14 def call search.result end |
#search ⇒ Object
18 19 20 |
# File 'app/models/renalware/patients/mdm_list_query.rb', line 18 def search @search ||= relation.extending(Scopes).with_current_modality(modality) end |