Class: Ting::Writer
Instance Method Summary collapse
- #generate(syll) ⇒ Object (also: #<<, #unparse, #call)
-
#initialize(conv, tone) ⇒ Writer
constructor
A new instance of Writer.
Methods included from Procable
Constructor Details
Instance Method Details
#generate(syll) ⇒ Object Also known as: <<, unparse, call
10 11 12 13 14 15 16 17 |
# File 'lib/ting/writer.rb', line 10 def generate(syll) Array(syll).map do |s| syllable = Conversions.unparse(@conv, s) str = @tone.add_tone(syllable, s.tone) str.capitalize! if s.capitalized? str end.join(' ') end |