Sha256: b6ee329357a14857a9926ff0ebe9fb0b75791858494637f5efc79d438f8b6727
Contents?: true
Size: 880 Bytes
Versions: 1
Compression:
Stored size: 880 Bytes
Contents
module Egnyte class Helper # removes leading and trailing '/' # from folder and file names. def self.normalize_path(path) path.gsub(/(^\/)|(\/$)/, '') end def self.params_to_s(params) str = '' if params str = "?" params.each_with_index do |(k,v),i| v.split('|') if v.instance_of? Array str += "#{k}=#{v}" str += "&" unless i == params.size - 1 end end return str end def self.params_to_filter_string(params) str = '' if params str = "?" params.each_with_index do |(k,v),i| str += "filter=" str += "#{k} eq \"#{v}\"" str += "&" unless i == params.size - 1 end end return str end def self.encode_url(url) URI.encode(url).gsub("[","%5B").gsub("]","%5D") end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ruby-egnyte-0.1.6 | lib/egnyte/helper.rb |