Class: Renalware::Patients::MessagesComponent

Inherits:
ApplicationComponent show all
Includes:
Pagy::Backend, Pagy::Frontend, ToggleHelper
Defined in:
app/components/renalware/patients/messages_component.rb

Constant Summary collapse

TITLE =
"Messages"

Instance Method Summary collapse

Methods included from ToggleHelper

#css_toggle_link_to, #row_toggler, #rows_toggler, #table_toggler, #td_toggle_row, #th_toggle_all_rows, #toggler

Methods inherited from ApplicationComponent

#policy, #renalware

Instance Method Details

#messagesObject



18
19
20
21
# File 'app/components/renalware/patients/messages_component.rb', line 18

def messages
  load_messages unless @messages
  @messages
end

#paginationObject



13
14
15
16
# File 'app/components/renalware/patients/messages_component.rb', line 13

def pagination
  load_messages unless @pagination
  @pagination
end

#titleObject



23
24
25
26
27
28
29
# File 'app/components/renalware/patients/messages_component.rb', line 23

def title
  if pagination.items < pagination.count
    "#{TITLE} (#{pagination.items} of #{pagination.count})"
  else
    "#{TITLE} (#{pagination.count})"
  end
end