I am using Twilio Say verbs repeatedly and want to refactor my code. Currently it looks somewhat like this
def sample
render text: (Twilio::TwiML::Response.new do |r|
r.Say 'Welcome to ABC Residence', voice: 'alice', language: 'en-GB'
r.Say 'Thank you for visiting ABC Residence.', voice:'alice', language: 'en-GB'
r.Hangup
end).text
end
Notice tht I'm using voice: 'alice'
and language: 'en-GB'
twice. How can I put these into a variable to be used over and over again?