Class: Renalware::HD::Scheduling::FindOrCreateDiaryByWeekQuery

Inherits:
Object
  • Object
show all
Defined in:
app/models/renalware/hd/scheduling/find_or_create_diary_by_week_query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(unit_id:, week_period:, by:, relation: WeeklyDiary.all) ⇒ FindOrCreateDiaryByWeekQuery

Returns a new instance of FindOrCreateDiaryByWeekQuery.



15
16
17
18
19
20
# File 'app/models/renalware/hd/scheduling/find_or_create_diary_by_week_query.rb', line 15

def initialize(unit_id:, week_period:, by:, relation: WeeklyDiary.all)
  @relation = relation
  @period = week_period
  @unit_id = unit_id
  @by = by
end

Instance Attribute Details

#byObject (readonly)

Returns the value of attribute by.



13
14
15
# File 'app/models/renalware/hd/scheduling/find_or_create_diary_by_week_query.rb', line 13

def by
  @by
end

#periodObject (readonly)

Returns the value of attribute period.



13
14
15
# File 'app/models/renalware/hd/scheduling/find_or_create_diary_by_week_query.rb', line 13

def period
  @period
end

#relationObject (readonly)

Returns the value of attribute relation.



13
14
15
# File 'app/models/renalware/hd/scheduling/find_or_create_diary_by_week_query.rb', line 13

def relation
  @relation
end

#unit_idObject (readonly)

Returns the value of attribute unit_id.



13
14
15
# File 'app/models/renalware/hd/scheduling/find_or_create_diary_by_week_query.rb', line 13

def unit_id
  @unit_id
end

Instance Method Details

#callObject



22
23
24
# File 'app/models/renalware/hd/scheduling/find_or_create_diary_by_week_query.rb', line 22

def call
  find_or_create_diary
end