Class: Twilio::TwiML::MessagingResponse
- Defined in:
- lib/twilio-ruby/twiml/messaging_response.rb
Overview
<Response> TwiML for Messages
Instance Attribute Summary
Attributes inherited from TwiML
Instance Method Summary collapse
-
#initialize(**keyword_args) {|_self| ... } ⇒ MessagingResponse
constructor
A new instance of MessagingResponse.
-
#message(body: nil, to: nil, from: nil, action: nil, method: nil, status_callback: nil, **keyword_args) {|message| ... } ⇒ Object
- Create a new <Message> element body
- Message Body to
- Phone Number to send Message to from
- Phone Number to send Message from action
-
A URL specifying where Twilio should send status callbacks for the created outbound message.
-
#redirect(url, method: nil, **keyword_args) ⇒ Object
- Create a new <Redirect> element url
- Redirect URL method
- Redirect URL method keyword_args
-
additional attributes.
Methods inherited from TwiML
#add_child, #add_text, #append, #comment, to_lower_camel_case, #to_s, #xml
Constructor Details
#initialize(**keyword_args) {|_self| ... } ⇒ MessagingResponse
Returns a new instance of MessagingResponse.
14 15 16 17 18 19 |
# File 'lib/twilio-ruby/twiml/messaging_response.rb', line 14 def initialize(**keyword_args) super(**keyword_args) @name = 'Response' yield(self) if block_given? end |
Instance Method Details
#message(body: nil, to: nil, from: nil, action: nil, method: nil, status_callback: nil, **keyword_args) {|message| ... } ⇒ Object
Create a new <Message> element
- body
-
Message Body
- to
-
Phone Number to send Message to
- from
-
Phone Number to send Message from
- action
-
A URL specifying where Twilio should send status callbacks for the created outbound message.
- method
-
Action URL Method
- status_callback
-
Status callback URL. Deprecated in favor of action.
- keyword_args
-
additional attributes
30 31 32 33 34 35 |
# File 'lib/twilio-ruby/twiml/messaging_response.rb', line 30 def (body: nil, to: nil, from: nil, action: nil, method: nil, status_callback: nil, **keyword_args) = Message.new(body: body, to: to, from: from, action: action, method: method, status_callback: status_callback, **keyword_args) yield() if block_given? append() end |
#redirect(url, method: nil, **keyword_args) ⇒ Object
Create a new <Redirect> element
- url
-
Redirect URL
- method
-
Redirect URL method
- keyword_args
-
additional attributes
42 43 44 |
# File 'lib/twilio-ruby/twiml/messaging_response.rb', line 42 def redirect(url, method: nil, **keyword_args) append(Redirect.new(url, method: method, **keyword_args)) end |