Exception: Walruz::NotAuthorized

Inherits:
Exception
  • Object
show all
Defined in:
lib/walruz/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(actor, subject, action, error_message = nil) ⇒ NotAuthorized

Returns a new instance of NotAuthorized.



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/walruz/exceptions.rb', line 9

def initialize(actor, subject, action, error_message = nil)
  @actor   = actor
  @subject = subject
  @action  = action
  
  if error_message.nil?
    super
  else
    super(error_message)
  end
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



7
8
9
# File 'lib/walruz/exceptions.rb', line 7

def action
  @action
end

#actorObject (readonly)

Returns the value of attribute actor.



5
6
7
# File 'lib/walruz/exceptions.rb', line 5

def actor
  @actor
end

#subjectObject (readonly)

Returns the value of attribute subject.



6
7
8
# File 'lib/walruz/exceptions.rb', line 6

def subject
  @subject
end