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(message: nil, to: nil, from: nil, action: nil, method: nil, **keyword_args) {|message| ... } ⇒ Object
- Create a new <Message> element message
- Message Body to
- Phone Number to send Message to from
- Phone Number to send Message from action
- Action URL method
- Action URL Method keyword_args
-
additional attributes.
-
#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
#append, to_lower_camel_case, #to_s, #xml
Constructor Details
#initialize(**keyword_args) {|_self| ... } ⇒ MessagingResponse
Returns a new instance of MessagingResponse.
12 13 14 15 16 17 |
# File 'lib/twilio-ruby/twiml/messaging_response.rb', line 12 def initialize(**keyword_args) super(**keyword_args) @name = 'Response' yield(self) if block_given? end |
Instance Method Details
#message(message: nil, to: nil, from: nil, action: nil, method: nil, **keyword_args) {|message| ... } ⇒ Object
Create a new <Message> element
- message
-
Message Body
- to
-
Phone Number to send Message to
- from
-
Phone Number to send Message from
- action
-
Action URL
- method
-
Action URL Method
- keyword_args
-
additional attributes
27 28 29 30 31 32 |
# File 'lib/twilio-ruby/twiml/messaging_response.rb', line 27 def (message: nil, to: nil, from: nil, action: nil, method: nil, **keyword_args) = Message.new(message: , to: to, from: from, action: action, method: method, **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
39 40 41 |
# File 'lib/twilio-ruby/twiml/messaging_response.rb', line 39 def redirect(url, method: nil, **keyword_args) append(Redirect.new(url, method: method, **keyword_args)) end |