Sha256: c4ff26bbcebbcc96c97ffec44e7e60d16d56a0872cbe45e449d1d694f75aa936
Contents?: true
Size: 653 Bytes
Versions: 16
Compression:
Stored size: 653 Bytes
Contents
class Zendesk2::Client class Real def search_help_center_articles(query) request( :method => :get, :params => {query: query}, :path => "/help_center/articles/search.json", ) end end # Real class Mock def search_help_center_articles(query) terms = Hash[query.split(" ").map { |t| t.split(":") }] collection = self.data[:help_center_articles].values results = collection.select { |v| terms.all?{ |term, condition| v[term.to_s].to_s == condition.to_s } } response( :path => "/search.json", :body => {"results" => results}, ) end end # Mock end
Version data entries
16 entries across 16 versions & 1 rubygems