lib/zendesk2/searchable.rb in zendesk2-0.1.1 vs lib/zendesk2/searchable.rb in zendesk2-0.1.2

- old
+ new

@@ -2,16 +2,21 @@ def self.included(klass) klass.send(:extend, Zendesk2::Searchable::Attributes) end def search(parameters) - body = connection.search(parameters.merge("type" => self.class.search_type)).body + body = connection.send(self.class.search_request, parameters.merge("type" => self.class.search_type)).body if data = body.delete("results") load(data) end merge_attributes(body) end module Attributes attr_accessor :search_type + attr_writer :search_request + + def search_request + @search_request ||= :search + end end end