Class: Voicemail::MailboxController
- Inherits:
-
ApplicationController
- Object
- Adhearsion::CallController
- ApplicationController
- Voicemail::MailboxController
- Defined in:
- lib/voicemail/call_controllers/mailbox_controller.rb
Instance Attribute Summary collapse
-
#new_or_saved ⇒ Object
Returns the value of attribute new_or_saved.
Instance Method Summary collapse
- #get_count ⇒ Object
- #play_message_count ⇒ Object
- #play_number_of_messages(new_or_saved) ⇒ Object
- #run ⇒ Object
Methods inherited from ApplicationController
Instance Attribute Details
#new_or_saved ⇒ Object
Returns the value of attribute new_or_saved.
4 5 6 |
# File 'lib/voicemail/call_controllers/mailbox_controller.rb', line 4 def new_or_saved @new_or_saved end |
Instance Method Details
#get_count ⇒ Object
42 43 44 |
# File 'lib/voicemail/call_controllers/mailbox_controller.rb', line 42 def get_count @number = storage.send "count_#{new_or_saved}_messages", mailbox[:id] end |
#play_message_count ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/voicemail/call_controllers/mailbox_controller.rb', line 27 def case config.numeric_method when :i18n_string play I18n.t("voicemail.mailbox.x_#{new_or_saved}_messages", count: @number) when :play_numeric play config.mailbox.number_before play_numeric @number play config.mailbox["number_after_#{new_or_saved}".to_sym] when :ahn_say play config.mailbox.number_before play *sounds_for_number(@number) play config.mailbox["number_after_#{new_or_saved}".to_sym] end end |
#play_number_of_messages(new_or_saved) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/voicemail/call_controllers/mailbox_controller.rb', line 16 def (new_or_saved) @new_or_saved = new_or_saved get_count if @number > 0 else play config.["no_#{new_or_saved}_messages".to_sym] end end |
#run ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/voicemail/call_controllers/mailbox_controller.rb', line 6 def run if mailbox :new :saved else mailbox_not_found end end |