Class: EchoCraft::ServiceObjects::Update

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

Overview

Basic Response to Update a Record on ServiceObject

Instance Attribute Summary collapse

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, params) ⇒ Update



10
11
12
13
14
# File 'lib/echo_craft/service_objects/update.rb', line 10

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

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



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

def params
  @params
end

Instance Method Details

#updatedObject



16
17
18
19
# File 'lib/echo_craft/service_objects/update.rb', line 16

def updated
  change_status(:ok)
  set_service_successful
end