Class: Ifin24::Console
- Inherits:
-
Object
- Object
- Ifin24::Console
- Defined in:
- lib/ifin24/console.rb
Instance Method Summary collapse
- #add_expense ⇒ Object
-
#initialize(client) ⇒ Console
constructor
A new instance of Console.
- #list_accounts ⇒ Object
- #list_entries ⇒ Object
- #main_menu ⇒ Object
Constructor Details
#initialize(client) ⇒ Console
Returns a new instance of Console.
5 6 7 |
# File 'lib/ifin24/console.rb', line 5 def initialize(client) @client = client end |
Instance Method Details
#add_expense ⇒ Object
27 28 29 |
# File 'lib/ifin24/console.rb', line 27 def add_expense execute_command(Ifin24::Commands::AddExpense) end |
#list_accounts ⇒ Object
31 32 33 |
# File 'lib/ifin24/console.rb', line 31 def list_accounts execute_command(Ifin24::Commands::ListAccounts) end |
#list_entries ⇒ Object
35 36 37 |
# File 'lib/ifin24/console.rb', line 35 def list_entries execute_command(Ifin24::Commands::ListEntries) end |
#main_menu ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/ifin24/console.rb', line 9 def catch :exit do loop do choose do || .header = "Menu główne" .index = :letter .index_suffix = ") " .choice("Dodaj wydatek") { add_expense } .choice("Lista kont") { list_accounts } .choice("Lista ostatnich transakcji") { list_entries } .choice("Koniec") { throw :exit } end end end end |