Git Product home page Git Product logo

Comments (3)

keshavbiswa avatar keshavbiswa commented on June 16, 2024 1

I think we already have Faker::Number.number that can be of use in this case. Also since we have a Faker::IDNumber generator, having another .id will make it confusing.

let(:user_id) { Faker::Number.number(digits: 10) }

Hope this helps. 🙂

from faker.

hubertjakubiak avatar hubertjakubiak commented on June 16, 2024

Hey @keshavbiswa,

Thanks for the input! I see where you're coming from with the availability of Faker::Number.number(digits: 10). It's definitely a handy feature for generating numeric identifiers.

However, having a dedicated Faker::Internet.id method could provide a more intuitive and semantic way of generating unique identifiers specifically for internet-related scenarios, like simulating user IDs or session tokens. It would align better with the context of internet-related data generation.

Additionally, while Faker::IDNumber is available, it might not be immediately obvious to users that it can be used for generating internet-related IDs. By having a separate .id method within the Faker::Internet module, we could provide clarity and ease of use for those specifically seeking internet-related identifiers.

So, while Faker::Number.number(digits: 10) is useful, having a dedicated Faker::Internet.id method could enhance the readability and usability of the Faker gem for scenarios where internet-related identifiers are needed.

Thanks for considering this perspective!

from faker.

thdaraujo avatar thdaraujo commented on June 16, 2024

Thanks for the suggestion @hubertjakubiak .

But I think a numeric identifier is a random positive number, so not sure if it's worth to add another generator if the random number generator solves the problem well.

Maybe if we had a database module with specific generators (serial, bigserial, uuid, etc.), maybe that would make sense. But Faker::Internet.id would not be very explicit on what's going to be generated. In my mind, an Internet ID can be pretty much anything.

from faker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.