Class: Multipri::App
- Inherits:
-
Object
- Object
- Multipri::App
- Defined in:
- lib/multipri/app.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(ui, table) ⇒ App
constructor
A new instance of App.
- #run(input) ⇒ Object
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 |