Class: Renalware::Pathology::ObservationsWithinDateRangeQuery

Inherits:
Object
  • Object
show all
Defined in:
app/models/renalware/pathology/observations_within_date_range_query.rb

Overview

Responsible for finding the most recent observations results with in the specified date range.

Instance Method Summary collapse

Constructor Details

#initialize(date_range:, relation: Observation.all) ⇒ ObservationsWithinDateRangeQuery

Returns a new instance of ObservationsWithinDateRangeQuery.



11
12
13
14
# File 'app/models/renalware/pathology/observations_within_date_range_query.rb', line 11

def initialize(date_range:, relation: Observation.all)
  @relation = relation
  @date_range = date_range
end

Instance Method Details

#callObject



16
17
18
# File 'app/models/renalware/pathology/observations_within_date_range_query.rb', line 16

def call
  @relation.where(observed_at: @date_range)
end