Module: Auth::Concerns::NotificationResponseConcern

Extended by:
ActiveSupport::Concern
Defined in:
app/models/auth/concerns/notification_response_concern.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#add_response(json_response) ⇒ Object

the idea here is the process the response by means of a block. json response should be a string representation of a valid json object.



27
28
29
30
# File 'app/models/auth/concerns/notification_response_concern.rb', line 27

def add_response(json_response)
	self.responses << json_response
	yield if block_given?
end

#get_parent_notificationObject

returns the parent notificatino object of this notification response.



33
34
35
# File 'app/models/auth/concerns/notification_response_concern.rb', line 33

def get_parent_notification
	Auth.configuration.notification_class.constantize.find(self.parent_notification_id)
end

#set_webhook_identifier(response) ⇒ Object

fixes the identifier by which this response can be identified during webhook calls.

Parameters:

  • response (String)

    : the json string that contains the response that was obtained by sending the notification.



41
42
43
# File 'app/models/auth/concerns/notification_response_concern.rb', line 41

def set_webhook_identifier(response)
	
end