module ClientForPoslynx::FakePosTerminal::ConsoleUserInterface::ContentFormatter
Public Instance Methods
card_swipe_request(request_data)
click to toggle source
# File lib/client_for_poslynx/fake_pos_terminal/console_user_interface/content_formatter.rb, line 61 def card_swipe_request(request_data) total = request_data.amount transaction = 'PURCHASE' lines = [] lines << "Please swipe your card" lines << "Total: " + format_usd( total ) if total lines << "Transaction: " + transaction multiline_message( lines ) end
multiline_message(text_lines)
click to toggle source
# File lib/client_for_poslynx/fake_pos_terminal/console_user_interface/content_formatter.rb, line 14 def multiline_message(text_lines) centered_lines = text_lines.map { |text| text.center(68) } "\n" << centered_lines * "\n" << "\n\n" end
payment_confirmation(amount)
click to toggle source
# File lib/client_for_poslynx/fake_pos_terminal/console_user_interface/content_formatter.rb, line 54 def payment_confirmation(amount) lines = [] lines << "TOTAL AMOUNT" lines << format_usd( amount ) multiline_message(lines) end
signature_entry_box()
click to toggle source
# File lib/client_for_poslynx/fake_pos_terminal/console_user_interface/content_formatter.rb, line 41 def signature_entry_box ' Sign here... ----------------------------------------------------------- | | | | | | ----------------------------------------------------------- ' end
welcome_with_idle_prompt(prompt)
click to toggle source
# File lib/client_for_poslynx/fake_pos_terminal/console_user_interface/content_formatter.rb, line 29 def welcome_with_idle_prompt(prompt) ' ___ _ _ ___ | | | | | / \ / \ | | | | | | | | | | | |\ /| | | | | |-- | | | | | \ / | |-- | / \ | | | | | | | | | | \/ \/ |___ |___ \_/ \_/ | | | |___ ' + " (#{prompt})\n" end