Module: Assistly::Client::Case

Included in:
Assistly::Client
Defined in:
lib/assistly/client/case.rb

Overview

Defines methods related to cases

Instance Method Summary collapse

Instance Method Details

#case(id, *args) ⇒ Object

Returns extended information on a single case

@option options [String] @example Return extended information for 12345 Assistly.case(12345) Assistly.case(12345, :by => "external_id")

See Also:

Supported formats:

  • :json

Requires Authentication:

  • true



30
31
32
33
34
# File 'lib/assistly/client/case.rb', line 30

def case(id, *args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  response = get("cases/#{id}",options)
  response.case
end

#case_url(id) ⇒ Object



50
51
52
# File 'lib/assistly/client/case.rb', line 50

def case_url(id)
  "https://#{subdomain}.assistly.com/agent/case/#{id}"
end

#cases(*args) ⇒ Object

Returns extended information of cases

@option options [Boolean, String, Integer] @example Return extended information for 12345 Assistly.cases(:case_id => 12345) Assistly.cases(:email => "[email protected]", :count => 5) Assistly.cases(:since_id => 12345)

See Also:

Supported formats:

  • :json

Requires Authentication:

  • true



15
16
17
18
19
# File 'lib/assistly/client/case.rb', line 15

def cases(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  response = get("cases",options)
  response
end

#update_case(id, *args) ⇒ Object

Updates a single case

@option options [String] @example Return extended information for 12345 Assistly.update_case(12345, :subject => "New Subject")

See Also:

Supported formats:

  • :json

Requires Authentication:

  • true



44
45
46
47
48
# File 'lib/assistly/client/case.rb', line 44

def update_case(id, *args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  response = put("cases/#{id}",options)
  response.case
end