Sha256: 6f40ff2355aed054450f3d8628cb4362f8a688f5c0671293289422d21eea5085

Contents?: true

Size: 294 Bytes

Versions: 2

Compression:

Stored size: 294 Bytes

Contents

module Restcomm
  module Util
    def url_encode(hash)
      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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
restcomm-ruby-1.2.1 lib/restcomm-ruby/util.rb
restcomm-ruby-1.2.0 lib/restcomm-ruby/util.rb