Module: TotalRecall::DefaultHelper
- Included in:
- SessionHelper
- Defined in:
- lib/total_recall.rb
Instance Method Summary collapse
- #ask(question, &block) ⇒ Object
-
#ask_account(question, options = {}) ⇒ String
Prompts the user for an account-name.
- #config ⇒ Object
- #default ⇒ Object
- #extract_transaction(row) ⇒ Object
- #render_row(options = {}) ⇒ Object
- #row ⇒ Object
- #transaction ⇒ Object
Instance Method Details
#ask(question, &block) ⇒ Object
27 28 29 |
# File 'lib/total_recall.rb', line 27 def ask(question, &block) highline.ask(question, &block) end |
#ask_account(question, options = {}) ⇒ String
Prompts the user for an account-name.
45 46 47 48 49 50 |
# File 'lib/total_recall.rb', line 45 def ask_account(question, = {}) = { default: nil }.merge() highline.ask(question) do |q| q.default = [:default] if [:default] end end |
#config ⇒ Object
15 16 17 |
# File 'lib/total_recall.rb', line 15 def config @config end |
#default ⇒ Object
23 24 25 |
# File 'lib/total_recall.rb', line 23 def default @default end |
#extract_transaction(row) ⇒ Object
58 59 60 61 62 63 64 65 |
# File 'lib/total_recall.rb', line 58 def extract_transaction(row) @row = row transactions_config.each do |k,v| next if k[/^__/] self[k] = value_for(k, v) end self end |
#render_row(options = {}) ⇒ Object
52 53 54 55 56 |
# File 'lib/total_recall.rb', line 52 def render_row( = {}) = { columns: [] }.merge() _row = [:columns].map {|i| row[i] } $stderr.puts Terminal::Table.new(rows: [ _row ]) end |
#row ⇒ Object
19 20 21 |
# File 'lib/total_recall.rb', line 19 def row @row end |
#transaction ⇒ Object
11 12 13 |
# File 'lib/total_recall.rb', line 11 def transaction self end |