Class: Ifin24::Commands::AddExpense
- Defined in:
- lib/ifin24/commands/add_expense.rb
Instance Method Summary collapse
Methods inherited from Base
Methods included from Helpers::Printer
Constructor Details
This class inherits a constructor from Ifin24::Commands::Base
Instance Method Details
#execute ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/ifin24/commands/add_expense.rb', line 5 def execute entry = get_entry catch :all_ok do loop do choose do || .index = :letter .index_suffix = ") " .choice("Nazwa: #{entry.title}") { get_title(entry) } .choice("Data: #{entry.date}") { get_date(entry) } .choice("Konto: #{entry.account.name}") { get_account(entry) } .choice("Kategoria: #{entry.category_full_name}") { get_category(entry) } .choice("Kwota: #{entry.amount}") { get_amount(entry) } .choice("Tagi: #{entry.tags}") { (entry) } .choice("Opis: #{entry.note}") { get_note(entry) } .choice("Powrót do głównego menu") do throw :all_ok end .choice("Wyślij") do puts "Wysyłanie danych..." @client.send_entry(entry) throw :all_ok end end end end end |