Class: Voicemail::IntroMessageCreator
- Inherits:
-
Object
- Object
- Voicemail::IntroMessageCreator
- Defined in:
- lib/voicemail/intro_message_creator.rb
Instance Attribute Summary collapse
-
#current_message ⇒ Object
Returns the value of attribute current_message.
Instance Method Summary collapse
- #from_message ⇒ Object
-
#initialize(message) ⇒ IntroMessageCreator
constructor
A new instance of IntroMessageCreator.
- #intro_message ⇒ Object
- #time_message ⇒ Object
Constructor Details
#initialize(message) ⇒ IntroMessageCreator
Returns a new instance of IntroMessageCreator.
11 12 13 14 |
# File 'lib/voicemail/intro_message_creator.rb', line 11 def initialize() raise ArgumentError, "MailboxPlayMessageIntroController needs a valid message passed to it" unless @current_message = end |
Instance Attribute Details
#current_message ⇒ Object
Returns the value of attribute current_message.
9 10 11 |
# File 'lib/voicemail/intro_message_creator.rb', line 9 def @current_message end |
Instance Method Details
#from_message ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/voicemail/intro_message_creator.rb', line 34 def case config.numeric_method when :i18n_string I18n.t "voicemail.messages.message_received_from_x", from: from_string when :play_numeric [config..from, from_ssml] when :ahn_say [config..from, Ahnsay.sounds_for_digits(from_digits)] end end |
#intro_message ⇒ Object
16 17 18 |
# File 'lib/voicemail/intro_message_creator.rb', line 16 def Array() + Array() end |
#time_message ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/voicemail/intro_message_creator.rb', line 20 def case config.numeric_method when :i18n_string I18n.t "voicemail.messages.message_received_on_x", received_on: I18n.localize([:received]) when :play_numeric [config.., time_ssml] when :ahn_say [ config.., Ahnsay.sounds_for_time([:received], format: config.datetime_format) ] end end |