class Yharian::Speaker
Attributes
name[R]
Public Class Methods
new(name)
click to toggle source
# File lib/plugins/yhara.rb, line 19 def initialize(name) @name = name end
Public Instance Methods
talk(context)
click to toggle source
# File lib/plugins/yhara.rb, line 23 def talk(context) n = 7 words = (0..rand(n)).map { %w[y hara].choice }. inject {|r, e| r + (rand < 0.97 ? ' ' : ', ') + e } eos = %w(? ? . . . . . . . . !).choice [Remark.new(self,words, eos)] end
voice(context = nil)
click to toggle source
# File lib/plugins/yhara.rb, line 31 def voice(context = nil) @name end