Faker gem - Where is the data being fetched

215 views Asked by At

I'm trying to understand how the Faker rails gem works, so hopefully I can contribute to it. The project is found here: https://github.com/stympy/faker

Under ~/lib/faker/name.rb there will be code like this:

def first_name; fetch('name.first_name'); end

My problem is I don't understand where the hash with all the "name.first_name" is located.

1

There are 1 answers

0
fylooi On

Searching for "def fetch" shows me that the method is defined in lib/faker.rb.

fetch in turn calls translate, which delegates to I8n.translate.