Class: Twilio::Rails::Phone::Tree::Prompt
- Inherits:
-
Object
- Object
- Twilio::Rails::Phone::Tree::Prompt
- Defined in:
- lib/twilio/rails/phone/tree.rb
Instance Attribute Summary collapse
-
#after ⇒ Object
readonly
Returns the value of attribute after.
-
#gather ⇒ Object
readonly
Returns the value of attribute gather.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name:, message:, gather:, after:) ⇒ Prompt
constructor
A new instance of Prompt.
Constructor Details
#initialize(name:, message:, gather:, after:) ⇒ Prompt
Returns a new instance of Prompt.
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/twilio/rails/phone/tree.rb', line 40 def initialize(name:, message:, gather:, after:) @name = name&.to_sym raise Twilio::Rails::Phone::InvalidTreeError, "prompt name cannot be blank" if @name.blank? @messages = if .is_a?(Proc) else Twilio::Rails::Phone::Tree::MessageSet.new() end @gather = Twilio::Rails::Phone::Tree::Gather.new(gather) if gather.present? @after = Twilio::Rails::Phone::Tree::After.new(after) end |
Instance Attribute Details
#after ⇒ Object (readonly)
Returns the value of attribute after.
38 39 40 |
# File 'lib/twilio/rails/phone/tree.rb', line 38 def after @after end |
#gather ⇒ Object (readonly)
Returns the value of attribute gather.
38 39 40 |
# File 'lib/twilio/rails/phone/tree.rb', line 38 def gather @gather end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
38 39 40 |
# File 'lib/twilio/rails/phone/tree.rb', line 38 def @messages end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
38 39 40 |
# File 'lib/twilio/rails/phone/tree.rb', line 38 def name @name end |