class ZendeskAPI::Search
A rich factory that returns a class for your searches
Public Class Methods
cbp_path_regexes()
click to toggle source
# File lib/zendesk_api/search.rb, line 28 def self.cbp_path_regexes [] end
model_key()
click to toggle source
# File lib/zendesk_api/search.rb, line 40 def model_key "results" end
new(client, attributes)
click to toggle source
Quack like a Resource
Creates the correct resource class from ‘attributes`
# File lib/zendesk_api/search.rb, line 16 def self.new(client, attributes) present_result_type = (attributes[:result_type] || attributes["result_type"]).to_s result_type = ZendeskAPI::Helpers.modulize_string(present_result_type) klass = begin ZendeskAPI.const_get(result_type) rescue NameError Result end (klass || Result).new(client, attributes) end
resource_name()
click to toggle source
# File lib/zendesk_api/search.rb, line 35 def resource_name "search" end
Also aliased as: resource_path
search(client, options = {})
click to toggle source
Creates a search collection
# File lib/zendesk_api/search.rb, line 6 def self.search(client, options = {}) if (options.keys.map(&:to_s) & %w[query external_id]).empty? warn "you have not specified a query for this search" end ZendeskAPI::Collection.new(client, self, options) end