Class: Ifin24::Console
- Inherits:
-
Object
- Object
- Ifin24::Console
- Includes:
- Ifin24, Helpers::Menu
- 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
- #list_limits ⇒ Object
- #main_menu ⇒ Object
Methods included from Helpers::Menu
Constructor Details
#initialize(client) ⇒ Console
Returns a new instance of Console.
7 8 9 |
# File 'lib/ifin24/console.rb', line 7 def initialize(client) @client = client end |
Instance Method Details
#add_expense ⇒ Object
22 23 24 |
# File 'lib/ifin24/console.rb', line 22 def add_expense execute_command(Commands::AddExpense) end |
#list_accounts ⇒ Object
26 27 28 |
# File 'lib/ifin24/console.rb', line 26 def list_accounts execute_command(Commands::ListAccounts) end |
#list_entries ⇒ Object
30 31 32 |
# File 'lib/ifin24/console.rb', line 30 def list_entries execute_command(Commands::ListEntries) end |
#list_limits ⇒ Object
34 35 36 |
# File 'lib/ifin24/console.rb', line 34 def list_limits execute_command(Commands::ListLimits) end |
#main_menu ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/ifin24/console.rb', line 11 def ('Koniec') do || .header = "Menu główne" .choice("Dodaj wydatek") { add_expense } .choice("Lista kont") { list_accounts } .choice("Lista ostatnich transakcji") { list_entries } .choice("Kontrola wydatków") { list_limits } end end |