Skip to content

Commit

Permalink
Enforce proper date formatting for Time params
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Diaz-Padron committed Dec 23, 2013
1 parent 68614ff commit 05cbb91
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/twilio-ruby/util.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
module Twilio
module Util
def url_encode(hash)
hash.to_a.map {|p| p.map {|e| CGI.escape e.to_s}.join '='}.join '&'
hash.to_a.map {|p| p.map {|e| CGI.escape get_string(e)}.join '='}.join '&'
end

def get_string(obj)
if obj.respond_to?(:strftime)
obj.strftime('%Y-%m-%d')
else
obj.to_s
end
end
end
end

0 comments on commit 05cbb91

Please sign in to comment.