Sha256: 61a33cc6098fb1c578703f8cbf15bb548be0705284dac7a71ee9ed25140548a4
Contents?: true
Size: 432 Bytes
Versions: 6
Compression:
Stored size: 432 Bytes
Contents
require 'ostruct' module OpenpayUtils class SearchParams < OpenStruct #"?creation[gte]=2013-11-01&limit=2&amount[lte]=100" def to_str filter = '?' self.marshal_dump.each do |attribute, value| if attribute =~ /(\w+)_(gte|lte)/ attribute = "#{$1}[#{$2}]" end filter << "#{attribute}=#{value}&" end filter.sub(/\&$/, '') end alias :to_s :to_str end end
Version data entries
6 entries across 6 versions & 1 rubygems