Module: Restcomm::Util
- Included in:
- REST::BaseClient, Capability
- Defined in:
- lib/restcomm-ruby/util.rb,
lib/restcomm-ruby/util/capability.rb,
lib/restcomm-ruby/util/configuration.rb,
lib/restcomm-ruby/util/request_validator.rb
Defined Under Namespace
Classes: Capability, Configuration, RequestValidator
Instance Method Summary
collapse
Instance Method Details
#get_string(obj) ⇒ Object
7
8
9
10
11
12
13
|
# File 'lib/restcomm-ruby/util.rb', line 7
def get_string(obj)
if obj.respond_to?(:strftime)
obj.strftime('%Y-%m-%d')
else
obj.to_s
end
end
|
#url_encode(hash) ⇒ Object
3
4
5
|
# File 'lib/restcomm-ruby/util.rb', line 3
def url_encode(hash)
hash.to_a.map {|p| p.map {|e| CGI.escape get_string(e)}.join '='}.join '&'
end
|