Class: Twilio::TwiML::Message
- Defined in:
- lib/twilio-ruby/twiml/messaging_response.rb
Overview
<Message> TwiML Verb
Instance Attribute Summary
Attributes inherited from TwiML
Instance Method Summary collapse
-
#body(message, **keyword_args) ⇒ Object
- Create a new <Body> element message
- Message Body keyword_args
-
additional attributes.
-
#initialize(body: nil, **keyword_args) {|_self| ... } ⇒ Message
constructor
A new instance of Message.
-
#media(url, **keyword_args) ⇒ Object
- Create a new <Media> element url
- Media URL keyword_args
-
additional attributes.
Methods inherited from TwiML
#add_child, #add_text, #append, #comment, to_lower_camel_case, #to_s, #xml
Constructor Details
#initialize(body: nil, **keyword_args) {|_self| ... } ⇒ Message
Returns a new instance of Message.
61 62 63 64 65 66 |
# File 'lib/twilio-ruby/twiml/messaging_response.rb', line 61 def initialize(body: nil, **keyword_args) super(**keyword_args) @name = 'Message' @value = body unless body.nil? yield(self) if block_given? end |
Instance Method Details
#body(message, **keyword_args) ⇒ Object
Create a new <Body> element
- message
-
Message Body
- keyword_args
-
additional attributes
72 73 74 |
# File 'lib/twilio-ruby/twiml/messaging_response.rb', line 72 def body(, **keyword_args) append(Body.new(, **keyword_args)) end |
#media(url, **keyword_args) ⇒ Object
Create a new <Media> element
- url
-
Media URL
- keyword_args
-
additional attributes
80 81 82 |
# File 'lib/twilio-ruby/twiml/messaging_response.rb', line 80 def media(url, **keyword_args) append(Media.new(url, **keyword_args)) end |