Class: Voice
- Inherits:
-
Object
- Object
- Voice
- Defined in:
- lib/voice.rb
Instance Method Summary collapse
- #create_argument(option, value) ⇒ Object
-
#initialize(options = {}) ⇒ Voice
constructor
A new instance of Voice.
- #parse_options(options) ⇒ Object
- #run_command(options) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Voice
Returns a new instance of Voice.
2 3 4 |
# File 'lib/voice.rb', line 2 def initialize( = {}) run_command end |
Instance Method Details
#create_argument(option, value) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/voice.rb', line 20 def create_argument option, value if option == :string "'#{value}'" else "--#{option}=#{value}" end end |
#parse_options(options) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/voice.rb', line 12 def = "" .each do |option, value| += "#{create_argument(option, value)} " end return end |
#run_command(options) ⇒ Object
6 7 8 9 10 |
# File 'lib/voice.rb', line 6 def run_command command = "say #{} --progress" puts command system command end |