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.



227
228
229
# File 'lib/jsonapi/exceptions.rb', line 227

def initialize(message)
  @message = message
end

Instance Attribute Details

#messageObject

Returns the value of attribute message.



226
227
228
# File 'lib/jsonapi/exceptions.rb', line 226

def message
  @message
end

Instance Method Details

#errorsObject



231
232
233
234
235
236
# File 'lib/jsonapi/exceptions.rb', line 231

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