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


364
365
366
# File 'lib/jsonapi/exceptions.rb', line 364

def initialize(message)
  @message = message
end

Instance Attribute Details

#messageObject

Returns the value of attribute message


363
364
365
# File 'lib/jsonapi/exceptions.rb', line 363

def message
  @message
end

Instance Method Details

#errorsObject


368
369
370
371
372
373
374
# File 'lib/jsonapi/exceptions.rb', line 368

def errors
  [JSONAPI::Error.new(code: JSONAPI::LOCKED,
                      status: :locked,
                      title: I18n.translate('jsonapi-resources.exceptions.record_locked.title',
                                            default: 'Locked resource'),
                      detail: "#{message}")]
end