Class: Senrigan::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/senrigan/cli.rb

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ CLI

Returns a new instance of CLI.



5
6
7
# File 'lib/senrigan/cli.rb', line 5

def initialize(argv)
  @argv = argv.clone
end

Instance Method Details

#run!Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/senrigan/cli.rb', line 9

def run!
  clear_terminal
  show_header
  formatter = Senrigan::Formatter.new
  adapter = Senrigan::Adapter.new
  adapter.on do |entity|
    formatter.format_print(entity)
  end
  adapter.connect!
rescue Interrupt
  exit 0
end