Class: KanjiMaster::Random

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

Instance Method Summary collapse

Instance Method Details

#addressObject



25
26
27
# File 'lib/kanji_master/random.rb', line 25

def address
  Address.new(Address.data[rand(0..499)])
end

#chinese_number_characterObject Also known as: kanji_number, number_kanji



15
16
17
# File 'lib/kanji_master/random.rb', line 15

def chinese_number_character
  Constant::KANJI_NUMBER[rand(0..9)]
end

#nameObject



29
30
31
# File 'lib/kanji_master/random.rb', line 29

def name
  Name.new(Name.data[rand(0..499)])
end

#personObject



21
22
23
# File 'lib/kanji_master/random.rb', line 21

def person
  Person.new(Person.data[rand(0..499)])
end

#prefectureObject



11
12
13
# File 'lib/kanji_master/random.rb', line 11

def prefecture
  Prefecture.new(Prefecture.data[rand(1..47)])
end

#prefecture_hashObject



3
4
5
# File 'lib/kanji_master/random.rb', line 3

def prefecture_hash
  Prefecture.data[rand(1..47)]
end

#prefecture_nameObject



7
8
9
# File 'lib/kanji_master/random.rb', line 7

def prefecture_name
  Prefecture.data[rand(1..47)][:name]
end