Project

sawaal

0.0
No commit activity in last 3 years
No release in over 3 years
A helper module to allow user to ask a question on the terminal that has multiple choices
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.6
 Project Readme

sawaal Version

Build Coverage Quality Inline docs Downloads

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

  1. Fork it ( https://github.com/[my-github-username]/sawaal/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request