Module: Twilify
- Defined in:
- lib/twilio_mock/twilify.rb
Class Method Summary collapse
-
.process(something) ⇒ Object
extracted from the deprecated Twilio::REST::Utils.
Class Method Details
.process(something) ⇒ Object
extracted from the deprecated Twilio::REST::Utils
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/twilio_mock/twilify.rb', line 5 def process(something) if something.is_a? Hash something = something.to_a something = something.map { |pair| [process(pair[0]).to_sym, pair[1]] } something = something.flatten(1) Hash[*something] else something.to_s.split('_').map! do |s| [s[0,1].capitalize, s[1..-1]].join end.join end end |