RUser

RUser is a simple Ruby Gem to communicate with the randomuser.me API.

Build Status Coverage Status Code Climate Dependency Status

Installation

gem install ruser

or in your Gemfile

gem 'ruser'

Documentation

rdoc.info/github/simpleappgroup/ruser

Quickstart

Using RUser in it's simplest form is as easy as calling:

require 'ruser'

ruser = RUser::Person.new

puts "This user is a #{user.gender} named #{user.name.first_name}!"

Then you can access any of the following user attributes:

  • gender
  • name
    • first_name
    • last_name
    • title
  • location
    • street
    • city
    • state
    • zipcode
  • email
  • username
  • password
  • salt
  • md5
  • sha1
  • sha256
  • registered
  • dob
  • phone
  • cell
  • ssn
  • picture
  • seed

If you want to request a female or male user specifically, specify the :gender key in the options hash passed to new:

require 'ruser'

woman = RUser::Person.new({:gender => 'female'})

man = RUser::Person.new({:gender => 'male'})

If you want to request a specific user by their seed, specify the :seed key in the options hash passed to new:

require 'ruser'

lazyWolf = RUser::Person.new({:seed => 'lazyWolf'})

Contributing & Development

$ git clone https://github.com/simpleappgroup/ruser && cd ruser
$ bundle install
  • Fork the project.
  • Make your feature addition or bug fix. All specs should pass.
  • Add specs for your changes. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with version, or history. If you want to have your own version, that is fine but bump version in a commit by itself in another branch so a maintainer ignore it when your pull request is merged.
  • Send a pull request. Bonus points for topic branches.

License & Copyright

See LICENSE for details.