Class: TwimlBuilder

Inherits:
Builder::XmlMarkup
  • Object
show all
Defined in:
lib/twilio_bot/twiml_builder.rb

Instance Method Summary collapse

Instance Method Details

#tag!(name, *args, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/twilio_bot/twiml_builder.rb', line 4

def tag!(name, *args, &block)
  name = name.capitalize
  args = args.map do |arg|
    if arg.is_a?({}.class)
      arg.map { |k, v| [k.to_s.camelize(:lower), v] }.to_h
    else
      arg
    end
  end
  super
end