lib/talks/configuration.rb in talks-0.0.5 vs lib/talks/configuration.rb in talks-0.1.0
- old
+ new
@@ -38,9 +38,25 @@
def talk(type)
[message(type), voice(type)]
end
+ def default_message_for(command_name, position = :after)
+ "#{command_name} task #{position == :before ? 'started' : 'ended'}"
+ end
+
+ def message_for(command_name, position = :after)
+ command = command_name.to_sym
+ options[command] &&
+ options[command][(position == :before ? :before_message : :after_message)]
+ end
+
+ def voice_for(command_name)
+ command = command_name.to_sym
+ options[command] &&
+ options[command][:voice]
+ end
+
private
def symbolize_hash_keys(opts)
sym_opts = {}
opts.each do |key, value|