Class: Faker::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/faker.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.localeObject


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

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


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

def random
  @random || Random::DEFAULT
end

Class Method Details

.own_localeObject


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

def own_locale
  @locale
end