Exception: JSONAPI::Exceptions::RecordLocked

Inherits:
Error
  • Object
show all
Defined in:
lib/jsonapi/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ RecordLocked

Returns a new instance of RecordLocked.



284
285
286
# File 'lib/jsonapi/exceptions.rb', line 284

def initialize(message)
  @message = message
end

Instance Attribute Details

#messageObject

Returns the value of attribute message.



283
284
285
# File 'lib/jsonapi/exceptions.rb', line 283

def message
  @message
end

Instance Method Details

#errorsObject



288
289
290
291
292
293
# File 'lib/jsonapi/exceptions.rb', line 288

def errors
  [JSONAPI::Error.new(code: JSONAPI::LOCKED,
                      status: :locked,
                      title: 'Locked resource',
                      detail: "#{message}")]
end