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?
Fix failing spec
Add a better dsl
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 = Twilio::TwiML::Response.new do |r|
r.Say 'hello there'
puts response.text #=> "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Say>hello there</Say></Response>"