Class: KanjiMaster::Counter

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

Instance Method Summary collapse

Instance Method Details

#kanji(number) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/kanji_master/counter.rb', line 3

def kanji(number)
  number_array = number.to_s.split('').map(&:to_i)
  kanji_hash = Constant::KANJI_NUMBER
  kanji_string = ""
  number_array.each do |i|
    kanji_string = kanji_string + kanji_hash[i]
  end
  kanji_string
end