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

Version Path
zendesk2-1.4.1 lib/zendesk2/client/requests/search_help_center_articles.rb
zendesk2-1.4.0 lib/zendesk2/client/requests/search_help_center_articles.rb
zendesk2-1.3.3 lib/zendesk2/client/requests/search_help_center_articles.rb
zendesk2-1.3.2 lib/zendesk2/client/requests/search_help_center_articles.rb
zendesk2-1.3.1 lib/zendesk2/client/requests/search_help_center_articles.rb
zendesk2-1.3.0 lib/zendesk2/client/requests/search_help_center_articles.rb
zendesk2-1.2.10 lib/zendesk2/client/requests/search_help_center_articles.rb
zendesk2-1.2.9 lib/zendesk2/client/requests/search_help_center_articles.rb
zendesk2-1.2.7 lib/zendesk2/client/requests/search_help_center_articles.rb
zendesk2-1.2.6 lib/zendesk2/client/requests/search_help_center_articles.rb
zendesk2-1.2.5 lib/zendesk2/client/requests/search_help_center_articles.rb
zendesk2-1.2.4 lib/zendesk2/client/requests/search_help_center_articles.rb
zendesk2-1.2.3 lib/zendesk2/client/requests/search_help_center_articles.rb
zendesk2-1.2.2 lib/zendesk2/client/requests/search_help_center_articles.rb
zendesk2-1.2.1 lib/zendesk2/client/requests/search_help_center_articles.rb
zendesk2-1.2.0 lib/zendesk2/client/requests/search_help_center_articles.rb