0.0
No commit activity in last 3 years
No release in over 3 years
Fetch random users from randomuser.me
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.1
~> 2.14

Runtime

~> 0.7.3
~> 0.11.0
 Project Readme

Build Status Gem Version

Randomuserme

Ruby client for randomuser.me API

Installation

Add this line to your application's Gemfile:

gem 'randomuserme'

And then execute:

$ bundle

Or install it yourself as:

$ gem install randomuserme

Usage

Do require 'random_user_me' wherever you need to use the gem.

RandomUserMe::Client.get_random_user

RandomUserMe::Client.get_seeded_user(seed)

Both class methods return a RandomUser object like this:

#<RandomUser
    email: "sam.allen48@example.com",
    name: {"title"=>"ms", "first"=>"sam", "last"=>"allen"}, 
    username: "tinykoala240",
    password: "rovers",
    salt: "SFYSCm7m",
    md5: "bfa66b84466acda8fbca0c39d33a2adf",
    sha1: "0d4093b1852e0ff3e18868f5e9e5a661047545ee",
    sha256[64]: "14627852489fb1fc5e6504c0e860c9a068338ac3e8d9029d9b1...",
    gender: "male",
    registered: #<DateTime: 2002-10-01T15:35:12+02:00 ((2452549j,48912s,0n),+7200s,2299161j)>,
    dob: #<Date: 1987-11-09 ((2447109j,0s,0n),+0s,2299161j)>,
    phone: "016977 3421",
    cell: "0727-996-865",
    nationality: "GB",
    location: {"street"=>"3714 park avenue", "city"=>"newry", "state"=>"powys", "postcode"=>"O82 3AH"},
    picture: {"large"=>"http://api.randomuser.me/portraits/women/45.jpg", 
              "medium"=>"http://api.randomuser.me/portraits/med/women/45.jpg", 
              "thumbnail"=>"http://api.randomuser.me/portraits/thumb/women/45.jpg"
              }>

RandomUser instances include formatted attributes methods like:

  • first_name
  • last_name
  • full_name
  • formal_name
  • full_formal_name
  • full_location

Contributing

  1. Fork it
  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 new Pull Request