Sha256: 73777dcf777d40e24e4f8e985cdf3f1635329d4ca97336fe37eed06f12bb1d4b
Contents?: true
Size: 800 Bytes
Versions: 3
Compression:
Stored size: 800 Bytes
Contents
class String # returns a hash like params containing all the "get" params from a given url # Ex: # 'http://wiki.rego.co.il/doku.php?id=development:horizon3:plugins:core_extensions:start&do=edit&rev='.to_params # => {:id=>'development:horizon3:plugins:core_extensions:start', :do=>'edit', :rev=>nil} def to_params hash = {} params=self.split("?") if params.size > 1 params=params[1].split("&") params=params.collect{|param| param.split("=")} params.each do |param| hash[param[0].to_sym]=param[1] end end hash end # matches and replaces placeholders in form of %{foo} or %<foo> def interpolate(values_hash = {}, options = {}) StringInterpolation.interpolate(self, values_hash, options) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rego-ruby-ext-0.0.3 | lib/string.rb |
rego-ruby-ext-0.0.2 | lib/string.rb |
rego-ruby-ext-0.0.1 | lib/string.rb |