Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

naija-faker

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

naija-faker

  • 1.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Build Statuscodecov

naija-faker

This gem helps you generate fake Nigerian data on the fly for use in your projects.

Getting Started

To get started, follow the instructions below

  • install the gem gem install naija-faker
  • import it in your app using:
 require "naija-faker"
  • use it!
  NaijaFaker.fname

Available methods

Generate an array of people with first name, last name, age, bank and state

  • To generate an array of people, simply pass an amt value to person_list i.e NaijaFaker.person_list(amt: 2)
  • NB: Default amt is 5

 NaijaFaker.person_list(amt: 2)
  # outputs:
  [
    {:fname=> 'abdul', :lname=>'qadr', :age=>40, :email=> 'abdul.qadr@hey.com', :state=>'ekiti' },
    {:fname=>'frank', :lname=>'edoho', :age=>23, :email=> 'frank.edoho@gmail.com', :state=>'delta' }
  ]

Generate a random First name or Last name

  • NaijaFaker.fname //=> 'abraham'
  • NaijaFaker.lname //=> 'fatai

Generate a random First name or Last name that starts with a letter/letters

  • NaijaFaker.fname('r') //=> 'rahman'
  • NaijaFaker.lname('bo') //=> 'bolanle'

Generate a person hash map with random values for First name, Last name and Age

  • NB: Default age is between 18 - 50
 NaijaFaker.person
 # outputs:
  {
    :fname=>'abdul', :lname=>'qadr', :age=>20,
    :email=>'abdul.qadr@hey.com', :state=>'ekiti'
  }

-- To change the default min and max values for age, pass in min and max values as an object like below.

  • e.g:
  NaijaFaker.person(min:20, max:50)
  #outputs:
  {
    :fname=>'abdul', :lname=>'qadr', :age=>40,
    :email=>'abdul.qadr@hey.com', :state=>'ekiti', :bank=>'Access bank'
  }

Generate an array of only names

  • Simply pass amt to name_list() e.g

    NB: Default amt is 5

NaijaFaker.name_list(amt: 5)

Generate a random Nigerian state

  • Simply call NaijaFaker.state //=> 'Ondo'

Generate a bank name

  • Simply call NaijaFaker.bank //=> 'Access Bank'

Test

  • To run the test
#install rspec and simplecov:
gem install rspec
gem install simplecov

# in /lib, run
bundle exec rspec spec/naija-faker.spec.rb

Authors

👤 Adebola Adeniran

🤝 Contributors

👤 Nikhil Chaurasia

Show your support

Give a ⭐️ if you like this project!

Acknowledgments

📝 License

This project is MIT licensed.

FAQs

Package last updated on 20 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc