Class: ZendeskAPI::Search
- Inherits:
-
Object
- Object
- ZendeskAPI::Search
- Defined in:
- lib/zendesk_api/resources.rb
Defined Under Namespace
Classes: Result
Class Method Summary (collapse)
- + (Object) model_key
-
+ (Object) new(client, attributes)
Quack like a Resource Creates the correct resource class from the result_type passed in.
- + (Object) resource_name (also: resource_path)
-
+ (Object) search(client, options = {})
Creates a search collection.
Class Method Details
+ (Object) model_key
185 186 187 |
# File 'lib/zendesk_api/resources.rb', line 185 def model_key "results" end |
+ (Object) new(client, attributes)
Quack like a Resource Creates the correct resource class from the result_type passed in
167 168 169 170 171 172 173 174 175 176 |
# File 'lib/zendesk_api/resources.rb', line 167 def self.new(client, attributes) result_type = attributes["result_type"] if result_type result_type = ZendeskAPI::Helpers.modulize_string(result_type) klass = ZendeskAPI.const_get(result_type) rescue nil end (klass || Result).new(client, attributes) end |
+ (Object) resource_name Also known as: resource_path
179 180 181 |
# File 'lib/zendesk_api/resources.rb', line 179 def resource_name "search" end |
+ (Object) search(client, options = {})
Creates a search collection
157 158 159 160 161 162 163 |
# File 'lib/zendesk_api/resources.rb', line 157 def self.search(client, = {}) unless (%w{query external_id} & .keys.map(&:to_s)).any? warn "you have not specified a query for this search" end ZendeskAPI::Collection.new(client, self, ) end |