Class: OsCtl::Cli::Top::Main

Inherits:
Command
  • Object
show all
Defined in:
lib/osctl/cli/top/main.rb

Instance Attribute Summary

Attributes inherited from Command

#args, #gopts, #opts

Instance Method Summary collapse

Methods inherited from Command

#cli_opt, #format_output, #initialize, #osctld_call, #osctld_fmt, #osctld_open, #osctld_resp, #require_args!, run

Methods included from Utils::Humanize

#break_interval, #format_long_duration, #format_percent, #format_short_duration, #humanize_data, #humanize_time_ns, #parse_data

Constructor Details

This class inherits a constructor from OsCtl::Cli::Command

Instance Method Details

#startObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/osctl/cli/top/main.rb', line 5

def start
  model = Top::Model.new
  model.setup

  if gopts[:json]
    klass = Top::JsonExporter

  else
    klass = Top::Tui
  end

  view = klass.new(model, opts[:rate])
  view.start
end