Class: EchoCraft::ServiceObjects::Destroy

Inherits:
EchoCraft::ServiceObject show all
Defined in:
lib/echo_craft/service_objects/destroy.rb

Overview

Basic Response to Destroy a Record on ServiceObject

Instance Attribute Summary

Attributes inherited from EchoCraft::ServiceObject

#record, #successful

Attributes inherited from Response

#data, #message, #status

Instance Method Summary collapse

Methods inherited from EchoCraft::ServiceObject

#set_service_successful, #unprocessabled

Methods inherited from Response

#change_status

Constructor Details

#initialize(record) ⇒ Destroy

Returns a new instance of Destroy.



8
9
10
11
# File 'lib/echo_craft/service_objects/destroy.rb', line 8

def initialize(record)
  super()
  @record = record
end

Instance Method Details

#destroyedObject



13
14
15
16
# File 'lib/echo_craft/service_objects/destroy.rb', line 13

def destroyed
  change_status(:ok)
  set_service_successful
end