Exception: Card::Error::PermissionDenied

Inherits:
Card::Error
  • Object
show all
Defined in:
lib/card/error.rb

Overview

permission errors

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Card::Error

exception_view, problematic_exception_view, view_and_status

Constructor Details

#initialize(card) ⇒ PermissionDenied

Returns a new instance of PermissionDenied.



22
23
24
25
# File 'lib/card/error.rb', line 22

def initialize card
  @card = card
  super build_message
end

Instance Attribute Details

#cardObject (readonly)

Returns the value of attribute card.



20
21
22
# File 'lib/card/error.rb', line 20

def card
  @card
end

Instance Method Details

#build_messageObject



27
28
29
30
31
32
33
# File 'lib/card/error.rb', line 27

def build_message
  if (msg = @card.errors[:permission_denied])
    "for card #{@card.name}: #{msg}"
  else
    super
  end
end