Module: Faker::Config

Defined in:
lib/faker.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.localeObject


22
23
24
25
# File 'lib/faker.rb', line 22

def locale
  # Because I18n.locale defaults to :en, if we don't have :en in our available_locales, errors will happen
  @locale || (I18n.available_locales.include?(I18n.locale) ? I18n.locale : I18n.available_locales.first)
end

.randomObject


31
32
33
# File 'lib/faker.rb', line 31

def random
  @random || Random.new
end

Class Method Details

.own_localeObject


27
28
29
# File 'lib/faker.rb', line 27

def own_locale
  @locale
end