Class: EchoCraft::ServiceObject

Inherits:
Response
  • Object
show all
Defined in:
lib/echo_craft/service_object.rb

Overview

Basic Response to Service Objects

Instance Attribute Summary collapse

Attributes inherited from Response

#data, #message, #status

Instance Method Summary collapse

Methods inherited from Response

#change_status

Constructor Details

#initializeServiceObject



9
10
11
12
13
14
# File 'lib/echo_craft/service_object.rb', line 9

def initialize
  super
  @record = nil
  @successful = false
  @status = change_status(:accepted)
end

Instance Attribute Details

#recordObject

Returns the value of attribute record.



7
8
9
# File 'lib/echo_craft/service_object.rb', line 7

def record
  @record
end

#successfulObject

Returns the value of attribute successful.



7
8
9
# File 'lib/echo_craft/service_object.rb', line 7

def successful
  @successful
end

Instance Method Details

#set_service_successfulObject



16
17
18
# File 'lib/echo_craft/service_object.rb', line 16

def set_service_successful
  @successful = true
end

#unprocessabledObject



20
21
22
# File 'lib/echo_craft/service_object.rb', line 20

def unprocessabled
  change_status(:unprocessable_entity)
end