Skip to content
Browse files

Adding an example for getting a character.

  • Loading branch information...
1 parent 016b8a3 commit 698e2c748b1c22a5012ec8200d6582b0cd7b97b0 @stomar stomar committed Dec 15, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 examples/get_character.rb
View
12 examples/get_character.rb
@@ -0,0 +1,12 @@
+#!/usr/bin/env ruby
+
+require "rubygems"
+require "highline/import"
+
+choices = "ynaq"
+answer = ask("Your choice [#{choices}]? ") do |q|
+ q.echo = false
+ q.character = true
+ q.validate = /\A[#{choices}]\Z/
+ end
+say("Your choice: #{answer}")

0 comments on commit 698e2c7

Please sign in to comment.
Something went wrong with that request. Please try again.