Sha256: 5788d57599f423ba34dd431ef49c33e2a59e63bfed4fa57e74369002a1238259
Contents?: true
Size: 519 Bytes
Versions: 10
Compression:
Stored size: 519 Bytes
Contents
module Restfulie::Client::Feature::OpenSearch class PatternMatcher def match(params, pattern) params = params.collect do |key, value| [key, value] end pattern = params.inject(pattern) do |pattern, p| what = "{#{p[0]}}" if pattern[what] pattern[what]= "#{p[1]}" end what = "{#{p[0]}?}" if pattern[what] pattern[what]= "#{p[1]}" end pattern end pattern.gsub(/\{[^\?]*\?\}/,"") end end end
Version data entries
10 entries across 10 versions & 2 rubygems