sawaal
Table of Contents
Quickstart
Here is an example usage of this gem. This should be enough to get
started with sawaal
.
require 'sawaal'
selected = Sawaal::Selector.choose(
'which key is the best?', {
:key1 => 'key1 is the best',
:key2 => 'key2 is the best for sure',
:key3 => 'key3 might be the one',
:key4 => 'key4 is surely the best',
:key5 => 'key5'
})
puts selected
The only thing to remember is that in the choose call, you can use either a hash of options or an array. If you used an array, the return selected value will be the 0-based index of the selected item.
Installation
Add this line to your application's Gemfile:
gem 'sawaal'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sawaal
Contributing
- Fork it ( https://github.com/[my-github-username]/sawaal/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request