Module: Twilio::Util

Defined in:
lib/twilio-ruby/util.rb,
lib/twilio-ruby/util/configuration.rb

Defined Under Namespace

Classes: Configuration

Instance Method Summary collapse

Instance Method Details

#get_string(obj) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/twilio-ruby/util.rb', line 10

def get_string(obj)
  warn "'Twilio::Util::get_string has been deprecated."
  if obj.respond_to?(:strftime)
    obj.strftime('%Y-%m-%d')
  else
    obj.to_s
  end
end

#url_encode(hash) ⇒ Object



5
6
7
8
# File 'lib/twilio-ruby/util.rb', line 5

def url_encode(hash)
  warn "'Twilio::Util::url_encode has been deprecated."
  hash.to_a.map { |p| p.map { |e| CGI.escape get_string(e) }.join '=' }.join '&'
end