Class: RailsServerMonitor::LeftbarComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- RailsServerMonitor::LeftbarComponent
- Defined in:
- app/components/rails_server_monitor/leftbar_component.rb
Instance Attribute Summary collapse
-
#ctx ⇒ Object
readonly
Returns the value of attribute ctx.
Instance Method Summary collapse
- #groups ⇒ Object
-
#initialize(ctx:) ⇒ LeftbarComponent
constructor
A new instance of LeftbarComponent.
- #servers ⇒ Object
Constructor Details
#initialize(ctx:) ⇒ LeftbarComponent
Returns a new instance of LeftbarComponent.
6 7 8 |
# File 'app/components/rails_server_monitor/leftbar_component.rb', line 6 def initialize(ctx:) @ctx = ctx end |
Instance Attribute Details
#ctx ⇒ Object (readonly)
Returns the value of attribute ctx.
5 6 7 |
# File 'app/components/rails_server_monitor/leftbar_component.rb', line 5 def ctx @ctx end |
Instance Method Details
#groups ⇒ Object
10 11 12 |
# File 'app/components/rails_server_monitor/leftbar_component.rb', line 10 def groups @groups ||= RailsServerMonitor::ServerGroup.order(name: :asc).all end |
#servers ⇒ Object
14 15 16 |
# File 'app/components/rails_server_monitor/leftbar_component.rb', line 14 def servers @servers ||= RailsServerMonitor::Server.all.sort_by(&:display_name) end |