Method: QuickFaker#initialize
- Defined in:
- lib/quick_faker.rb
#initialize(locale = 'en-GB', debug: false) ⇒ QuickFaker
Returns a new instance of QuickFaker.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/quick_faker.rb', line 18 def initialize(locale='en-GB', debug: false) @debug = debug Faker::Config.locale = locale s = File.join(File.dirname(__FILE__), '..', 'data', 'faker.yaml') a = YAML.load(File.read(s)) @a = a.flat_map(&:last) load_methods(a) end |