Class: Renalware::HD::DiarySlot
Overview
Instance Attribute Summary collapse
-
#change_type ⇒ Object
Virtual attribute used on a form to determine what action as preformed on the slot.
Class Method Summary
collapse
Instance Method Summary
collapse
#first_or_create_by!, #save_by, #save_by!, #update_by
Instance Attribute Details
#change_type ⇒ Object
Virtual attribute used on a form to determine what action as preformed on the slot
29
30
31
|
# File 'app/models/renalware/hd/diary_slot.rb', line 29
def change_type
@change_type
end
|
Class Method Details
.policy_class ⇒ Object
57
58
59
|
# File 'app/models/renalware/hd/diary_slot.rb', line 57
def self.policy_class
DiaryPolicy
end
|
Instance Method Details
#cell_id ⇒ Object
78
79
80
|
# File 'app/models/renalware/hd/diary_slot.rb', line 78
def cell_id
"#{diurnal_period_code&.id}-#{station&.id}-#{day_of_week}"
end
|
#day_of_week_name ⇒ Object
74
75
76
|
# File 'app/models/renalware/hd/diary_slot.rb', line 74
def day_of_week_name
Time::DAYS_INTO_WEEK.keys[day_of_week - 1].capitalize
end
|
#description ⇒ Object
65
66
67
68
69
70
71
72
|
# File 'app/models/renalware/hd/diary_slot.rb', line 65
def description
period = diurnal_period_code.code.upcase if diary.master
"Recurring every #{day_of_week_name} #{period}"
else
"This week only on #{day_of_week_name} #{period}"
end
end
|
#on_master_diary? ⇒ Boolean
61
62
63
|
# File 'app/models/renalware/hd/diary_slot.rb', line 61
def on_master_diary?
diary&.master?
end
|