Sha256: d5b87c558e4e92b5dd705bbed5f6a5b1c3646a3e8671b77ad608af27339e6efc

Contents?: true

Size: 735 Bytes

Versions: 1

Compression:

Stored size: 735 Bytes

Contents

class Zendesk2::Client::Organizations < Zendesk2::PagedCollection
  include Zendesk2::Searchable

  model Zendesk2::Client::Organization

  def find_by_external_id(external_id)
    body = connection.get_organization_by_external_id(external_id).body
    if data = body.delete("organizations")
      collection = self.clone.load(data)
      collection.merge_attributes(Cistern::Hash.slice(body, "count", "next_page", "previous_page"))
      collection
    end
  end

  self.collection_method = :get_organizations
  self.collection_root   = "organizations"
  self.model_method      = :get_organization
  self.model_root        = "organization"
  self.search_type       = "organization"
  self.search_request    = :search_organization
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
zendesk2-1.4.2 lib/zendesk2/client/collections/organizations.rb