Sha256: d7d6d495b39042dd27d35d174eeb95c4c5d49bec650c099cd541302c782844e5

Contents?: true

Size: 388 Bytes

Versions: 11

Compression:

Stored size: 388 Bytes

Contents

module Zendesk2::Searchable
  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
    if data = body.delete("results")
      load(data)
    end
    merge_attributes(body)
  end

  module Attributes
    attr_accessor :search_type
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
zendesk2-0.1.1 lib/zendesk2/searchable.rb
zendesk2-0.1.0 lib/zendesk2/searchable.rb
zendesk2-0.0.23 lib/zendesk2/searchable.rb
zendesk2-0.0.22 lib/zendesk2/searchable.rb
zendesk2-0.0.20 lib/zendesk2/searchable.rb
zendesk2-0.0.19 lib/zendesk2/searchable.rb
zendesk2-0.0.18 lib/zendesk2/searchable.rb
zendesk2-0.0.17 lib/zendesk2/searchable.rb
zendesk2-0.0.16 lib/zendesk2/searchable.rb
zendesk2-0.0.15 lib/zendesk2/searchable.rb
zendesk2-0.0.14 lib/zendesk2/searchable.rb