Sha256: 40cd7825b394c1bb579134743f80d93ebd439f2cede0b8962a60d5bd5c28cd3b

Contents?: true

Size: 319 Bytes

Versions: 19

Compression:

Stored size: 319 Bytes

Contents

module Sfn::Util
  def requestify(parameters, prefix=nil)
    parameters.inject({}) do |results, kv|
      if Hash === kv.last
        results = results.merge(requestify(kv.last, "#{prefix}[#{kv.first}]"))
      else
        results["#{prefix}[#{kv.first}]"] = kv.last
      end
        
      results
    end
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
nullstyle-ruby-satisfaction-0.4.0 lib/satisfaction/util.rb
pius-ruby-satisfaction-0.3.0 lib/satisfaction/util.rb
pius-ruby-satisfaction-0.4.0 lib/satisfaction/util.rb
pius-ruby-satisfaction-0.4.1 lib/satisfaction/util.rb
pius-ruby-satisfaction-0.4.2 lib/satisfaction/util.rb
pius-ruby-satisfaction-0.4.3 lib/satisfaction/util.rb
pius-ruby-satisfaction-0.4.4 lib/satisfaction/util.rb
ruby-satisfaction-0.7.5 lib/satisfaction/util.rb
ruby-satisfaction-0.7.4 lib/satisfaction/util.rb
ruby-satisfaction-0.7.3 lib/satisfaction/util.rb
ruby-satisfaction-0.7.0 lib/satisfaction/util.rb
ruby-satisfaction-0.6.7 lib/satisfaction/util.rb
ruby-satisfaction-0.6.5 lib/satisfaction/util.rb
ruby-satisfaction-0.6.4 lib/satisfaction/util.rb
ruby-satisfaction-0.6.3 lib/satisfaction/util.rb
ruby-satisfaction-0.6.2 lib/satisfaction/util.rb
ruby-satisfaction-0.6.1 lib/satisfaction/util.rb
ruby-satisfaction-0.3.0 lib/satisfaction/util.rb
ruby-satisfaction-0.4.0 lib/satisfaction/util.rb