Class: Delighted::SurveyRequest

Inherits:
Resource
  • Object
show all
Defined in:
lib/delighted/resources/survey_request.rb

Class Method Summary collapse

Methods inherited from Resource

#initialize, singleton_resource?, #to_hash

Constructor Details

This class inherits a constructor from Delighted::Resource

Class Method Details

.delete_pending(attributes = {}, client = Delighted.shared_client) ⇒ Object

Raises:

  • (ArgumentError)

5
6
7
8
9
10
11
# File 'lib/delighted/resources/survey_request.rb', line 5

def self.delete_pending(attributes = {}, client = Delighted.shared_client)
  raise ArgumentError, "You must pass :person_email" unless attributes[:person_email]
  interpolated_path = path.sub("{PERSON_EMAIL}", CGI.escape(attributes[:person_email]))
  interpolated_path << "/pending"
  json = client.delete_json(interpolated_path)
  json
end