Class: Renalware::Patients::MessagesComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Renalware::Patients::MessagesComponent
- Includes:
- Pagy::Backend, Pagy::Frontend, ToggleHelper
- Defined in:
- app/components/renalware/patients/messages_component.rb
Constant Summary collapse
- TITLE =
"Messages"
Instance Attribute Summary collapse
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#patient ⇒ Object
readonly
Returns the value of attribute patient.
Instance Method Summary collapse
-
#initialize(patient:, current_user:) ⇒ MessagesComponent
constructor
A new instance of MessagesComponent.
- #messages ⇒ Object
- #pagination ⇒ Object
- #title ⇒ Object
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
Constructor Details
#initialize(patient:, current_user:) ⇒ MessagesComponent
Returns a new instance of MessagesComponent.
13 14 15 16 17 |
# File 'app/components/renalware/patients/messages_component.rb', line 13 def initialize(patient:, current_user:) @patient = patient @current_user = current_user super end |
Instance Attribute Details
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
11 12 13 |
# File 'app/components/renalware/patients/messages_component.rb', line 11 def current_user @current_user end |
#patient ⇒ Object (readonly)
Returns the value of attribute patient.
11 12 13 |
# File 'app/components/renalware/patients/messages_component.rb', line 11 def patient @patient end |
Instance Method Details
#messages ⇒ Object
24 25 26 27 |
# File 'app/components/renalware/patients/messages_component.rb', line 24 def unless end |
#pagination ⇒ Object
19 20 21 22 |
# File 'app/components/renalware/patients/messages_component.rb', line 19 def pagination unless @pagination @pagination end |
#title ⇒ Object
29 30 31 32 33 34 35 |
# File 'app/components/renalware/patients/messages_component.rb', line 29 def title if pagination.items < pagination.count "#{TITLE} (#{pagination.items} of #{pagination.count})" else "#{TITLE} (#{pagination.items})" end end |