Class: Cogibara::FileHandler
- Inherits:
-
Object
- Object
- Cogibara::FileHandler
- Defined in:
- lib/cogibara/file_handler.rb
Instance Method Summary collapse
- #convert_to_audio(file) ⇒ Object
- #handle(file, clientID) ⇒ Object
- #handle_audio(file, clientID, options = {}) ⇒ Object
- #handle_image(file) ⇒ Object
- #handle_other(file) ⇒ Object
- #handle_video(file) ⇒ Object
Instance Method Details
#convert_to_audio(file) ⇒ Object
39 40 41 |
# File 'lib/cogibara/file_handler.rb', line 39 def convert_to_audio(file) end |
#handle(file, clientID) ⇒ Object
4 5 6 7 |
# File 'lib/cogibara/file_handler.rb', line 4 def handle(file, clientID) Responder.new.send_reply("@transcribe",clientID) handle_audio(file, clientID) end |
#handle_audio(file, clientID, options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/cogibara/file_handler.rb', line 9 def handle_audio(file, clientID, ={}) if Cogibara::config.active_file_mode if Cogibara::dispatcher.registered_file?(Cogibara::config.active_file_mode) response = Cogibara::dispatcher.call_file(Cogibara::config.active_file_mode, file) Responder.new.send_reply(response,clientID) else puts "active file mode #{Cogibara::config.active_file_mode} enabled but not registered, doing the regular thing" = Message.new(Transcriber.new.transcribe(file), clientID) Responder.new.send_reply("you: #{.text}",clientID) Cogibara::.handle() end else = Message.new(Transcriber.new.transcribe(file), clientID) Responder.new.send_reply("you: #{.text}",clientID) Cogibara::.handle() end end |
#handle_image(file) ⇒ Object
31 32 33 |
# File 'lib/cogibara/file_handler.rb', line 31 def handle_image(file) "images not yet implemented" end |
#handle_other(file) ⇒ Object
35 36 37 |
# File 'lib/cogibara/file_handler.rb', line 35 def handle_other(file) "#{file} not supported" end |
#handle_video(file) ⇒ Object
27 28 29 |
# File 'lib/cogibara/file_handler.rb', line 27 def handle_video(file) end |