Class: Renalware::Patients::SummaryPart

Inherits:
SummaryPart show all
Defined in:
app/presenters/renalware/patients/summary_part.rb

Constant Summary

Constants inherited from SummaryPart

SummaryPart::DATE_FORMAT

Instance Method Summary collapse

Methods inherited from SummaryPart

#cache?, #cache_key, #render?

Instance Method Details

#bookmarkObject



28
29
30
31
32
# File 'app/presenters/renalware/patients/summary_part.rb', line 28

def bookmark
  return if current_user.blank?

  patients_user.bookmark_for_patient(patient)
end

#bookmark_notesObject



24
25
26
# File 'app/presenters/renalware/patients/summary_part.rb', line 24

def bookmark_notes
  bookmark&.notes
end

#bookmark_tagsObject



38
39
40
41
42
43
44
45
46
47
48
# File 'app/presenters/renalware/patients/summary_part.rb', line 38

def bookmark_tags
  return [] if bookmark.blank?
  return [] if bookmark.tags.blank?

  bookmark
    .tags
    .split(",")
    .reject(&:blank?)
    .map(&:strip)
    .uniq
end

#bookmarked?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'app/presenters/renalware/patients/summary_part.rb', line 20

def bookmarked?
  bookmark.present?
end

#on_worryboard?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/presenters/renalware/patients/summary_part.rb', line 12

def on_worryboard?
  worry.present?
end

#patients_userObject



34
35
36
# File 'app/presenters/renalware/patients/summary_part.rb', line 34

def patients_user
  Patients.cast_user(current_user)
end

#to_partial_pathObject



8
9
10
# File 'app/presenters/renalware/patients/summary_part.rb', line 8

def to_partial_path
  "renalware/patients/summary_part"
end

#worryboard_notesObject



16
17
18
# File 'app/presenters/renalware/patients/summary_part.rb', line 16

def worryboard_notes
  worry&.notes
end