Class: Faker::JpPrefecture::Prefecture

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

Class Method Summary collapse

Class Method Details

.allObject



5
6
7
8
# File 'lib/faker/jp_prefecture/prefecture.rb', line 5

def self.all
  pref_hash = PREFECTURES.sample
  prefecture = OpenStruct.new(code: pref_hash[:code], name: pref_hash[:name], name_e: pref_hash[:name_e], name_f: pref_hash[:name_f])
end