class Yharian::Remark

Attributes

eos[R]
pronounciation[R]
speaker[R]
words[R]

Public Class Methods

new(speaker, words, eos, options = {}) click to toggle source
# File lib/plugins/yhara.rb, line 80
def initialize(speaker, words, eos, options = {})
  @speaker = speaker
  @words = words
  @eos = eos # end of text : "?" or "." or "!"
  @pronounciation = options[:pronounciation] || text
end

Public Instance Methods

correct?(s) click to toggle source
# File lib/plugins/yhara.rb, line 103
def correct?(s)
  s.gsub(/[^yhar]/,'') == @words.gsub(/[^yhar]/,'')
end
display() click to toggle source
# File lib/plugins/yhara.rb, line 95
def display
  puts "#{@speaker.name}: #{text}"
end
interrogative?() click to toggle source
# File lib/plugins/yhara.rb, line 91
def interrogative?
  @eos == '?'
end
say(context = nil) click to toggle source
# File lib/plugins/yhara.rb, line 99
def say(context = nil)
  Kernel.say pronounciation, :voice => @speaker.voice(context)
end
text() click to toggle source
# File lib/plugins/yhara.rb, line 87
def text
  @words + @eos
end