Exception: Card::PermissionDenied

Inherits:
Error show all
Defined in:
lib/card/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(card) ⇒ PermissionDenied

Returns a new instance of PermissionDenied.



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

def initialize card
  @card = card
  super build_message
end

Instance Attribute Details

#cardObject (readonly)

Returns the value of attribute card.



18
19
20
# File 'lib/card/exceptions.rb', line 18

def card
  @card
end

Instance Method Details

#build_messageObject



25
26
27
28
29
30
31
# File 'lib/card/exceptions.rb', line 25

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