Sha256: 18df49bff48f1df7bf90d7c37b2c6c34463dcb876ca74b2cdc06e09f0e2168ea
Contents?: true
Size: 463 Bytes
Versions: 15
Compression:
Stored size: 463 Bytes
Contents
class TerminalInputManager def get_validated(message) loop do print message.green user_input = STDIN.gets.chomp if yield(user_input) return user_input end end end def get(message) loop do print message.green user_input = STDIN.gets.chomp return user_input unless user_input.nil? || user_input.empty? end end end
Version data entries
15 entries across 15 versions & 1 rubygems