Class: Pvectl::Commands::Top::Handlers::Vms
- Inherits:
-
Object
- Object
- Pvectl::Commands::Top::Handlers::Vms
- Includes:
- ResourceHandler
- Defined in:
- lib/pvectl/commands/top/handlers/vms.rb
Overview
Handler for Top command VM metrics display.
Wraps Get::Handlers::Vms to fetch VM data and pairs it with TopVm presenter for metrics-focused output.
Instance Method Summary collapse
-
#initialize(get_handler: nil) ⇒ Vms
constructor
Creates handler with optional Get handler for dependency injection.
-
#list(sort: nil, **_) ⇒ Array<Models::Vm>
Lists VMs with optional sorting.
-
#presenter ⇒ Presenters::TopVm
Returns Top-specific presenter for VMs.
Constructor Details
#initialize(get_handler: nil) ⇒ Vms
Creates handler with optional Get handler for dependency injection.
26 27 28 |
# File 'lib/pvectl/commands/top/handlers/vms.rb', line 26 def initialize(get_handler: nil) @get_handler = get_handler end |
Instance Method Details
#list(sort: nil, **_) ⇒ Array<Models::Vm>
Lists VMs with optional sorting.
34 35 36 |
# File 'lib/pvectl/commands/top/handlers/vms.rb', line 34 def list(sort: nil, **_) get_handler.list(sort: sort) end |
#presenter ⇒ Presenters::TopVm
Returns Top-specific presenter for VMs.
41 42 43 |
# File 'lib/pvectl/commands/top/handlers/vms.rb', line 41 def presenter Presenters::TopVm.new end |