No commit activity in last 3 years
No release in over 3 years
Provides most of the functionality of http://api.randomuser.me without an external API call for Rails applications
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 4.1
 Project Readme

Random User / Local

I love the API at http://api.randomuser.me. However for some offline demos in some Rails apps I needed a local cache. This Rails plugin provides a local version of some of the data (basic US male and female profiles) generated by external calls to the API.

Uses the US data here: https://github.com/RandomAPI/Randomuser.me-Data

Installation

Add this line to your application's Gemfile:

gem 'randomuser-local-rails', require: 'randomuser_local'

And then execute:

$ bundle

Or install it yourself as:

$ gem install randomuser-local

Usage

Grab a single random user, returned as a hash:

RandomuserLocal.generate

Multiple random users:

RandomuserLocal.generate(5)

A single female random user:

RandomuserLocal.generate_female

Multiple female random users:

RandomuserLocal.generate_female(5)

A single male random user:

RandomuserLocal.generate_male

Multiple male random users:

RandomuserLocal.generate_male(5)

Contributing

  1. Fork it ( https://github.com/hpoydar/randomuser-local-rails/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

License