Sha256: df4b81afdbf128b93bd1e54eb717f4221ecc305b9b0d3573414566c42817a202

Contents?: true

Size: 682 Bytes

Versions: 12

Compression:

Stored size: 682 Bytes

Contents

class Zendesk2::Client::Organizations < Zendesk2::Collection
  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"
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
zendesk2-0.4.4 lib/zendesk2/client/models/organizations.rb
zendesk2-0.4.3 lib/zendesk2/client/models/organizations.rb
zendesk2-0.4.2 lib/zendesk2/client/models/organizations.rb
zendesk2-0.4.1 lib/zendesk2/client/models/organizations.rb
zendesk2-0.4.0 lib/zendesk2/client/models/organizations.rb
zendesk2-0.3.2 lib/zendesk2/client/models/organizations.rb
zendesk2-0.3.1 lib/zendesk2/client/models/organizations.rb
zendesk2-0.3.0 lib/zendesk2/client/models/organizations.rb
zendesk2-0.2.7 lib/zendesk2/client/models/organizations.rb
zendesk2-0.2.6 lib/zendesk2/client/models/organizations.rb
zendesk2-0.2.5 lib/zendesk2/client/models/organizations.rb
zendesk2-0.2.4 lib/zendesk2/client/models/organizations.rb