Class: SayWords

Inherits:
Object
  • Object
show all
Includes:
OS
Defined in:
lib/jwords/say_words.rb

Instance Method Summary collapse

Methods included from OS

#linux?, #mac?, #unix?, #windows?

Constructor Details

#initialize(options = {}) ⇒ SayWords

Returns a new instance of SayWords.



4
5
6
7
8
9
10
11
12
13
# File 'lib/jwords/say_words.rb', line 4

def initialize(options={})
  @db = DbWords.new
  @collection = @db.collection
  @show_message = options[:show_message].nil? ? SHOW_MESSAGE : options[:show_message]
  @space_words = options[:space_words] || SPACE_WORDS
  @space_interation = options[:space_interation] || SPACE_INTERATION
  @mac_word_voice = options[:mac_word_voice] || MAC_WORD_VOICE
  @mac_translate_voice = options[:mac_translate_voice] || MAC_TRANSLATE_VOICE
  @repeat = options[:repeat] || REPEAT
end

Instance Method Details

#runObject



15
16
17
18
19
20
21
# File 'lib/jwords/say_words.rb', line 15

def run
  if mac?
    do_mac
  elsif linux?
    do_ubuntu
  end
end