This gem returns simple JSON/hash responses from the Random User Generator API.
Add this line to your application's Gemfile:
gem 'randomuser'
And then execute:
$ bundle
Or install it as a standalone gem with:
$ gem install randomuser
To request a single random user:
Randomuser.generate
To request multiple random users:
Randomuser.generate(5)
To request a single female random user:
Randomuser.generate_female
To request multiple female random users:
Randomuser.generate_female(5)
To request a single male random user:
Randomuser.generate_male
To request multiple male random users:
Randomuser.generate_male(5)
To request a specific user:
Randomuser.generate_seed('foobar')
For more information on this API, please see the Random User Generator site.
Testing works as usual:
git clone https://github.com/humanshell/randomuser.git
cd randomuser
bundle install
rake
- Fork it
- 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 new Pull Request