Class: Multipri::App

Inherits:
Object
  • Object
show all
Defined in:
lib/multipri/app.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ui, table) ⇒ App

Returns a new instance of App.



10
11
12
13
# File 'lib/multipri/app.rb', line 10

def initialize(ui, table)
  @ui = ui
  @table = table
end

Class Method Details

.run(args) ⇒ Object



6
7
8
# File 'lib/multipri/app.rb', line 6

def self.run(args)
  new(CliUI, PrimesTable).run(args)
end

Instance Method Details

#run(input) ⇒ Object



15
16
17
18
# File 'lib/multipri/app.rb', line 15

def run(input)
  count = ui.read(input)
  ui.write(table.generate(count))
end