Better way to write responses #6

wants to merge 2 commits into from

2 participants


I'm building response blocks in the project I'm working on like these, It's fairly simple and way more readable for me.

I think this would be a nice addition to twilio, what do you guys think?


we just released a new version of the twilio ruby library called twilio-ruby. it includes a utility for building twiml responses that uses builder for xml. the class is here:

and here's how you'd use it:

response = do |r|
  r.Say 'hello there'

puts response.text #=> "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Say>hello there</Say></Response>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment