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.



270
271
272
# File 'lib/jsonapi/exceptions.rb', line 270

def initialize(message)
  @message = message
end

Instance Attribute Details

#messageObject

Returns the value of attribute message.



269
270
271
# File 'lib/jsonapi/exceptions.rb', line 269

def message
  @message
end

Instance Method Details

#errorsObject



274
275
276
277
278
279
# File 'lib/jsonapi/exceptions.rb', line 274

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