Exception: Moat::ActionNotFoundError

Inherits:
NotFoundError show all
Defined in:
lib/moat.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ ActionNotFoundError

Returns a new instance of ActionNotFoundError.



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

def initialize(options = {})
  return super if options.is_a?(String)
  @action = options[:action]
  @resource = options[:resource]
  @policy = options[:policy]
  @user = options[:user]

  message = options.fetch(:message) { "#{policy.name}##{action}" }
  super(message)
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



8
9
10
# File 'lib/moat.rb', line 8

def action
  @action
end

#policyObject (readonly)

Returns the value of attribute policy.



8
9
10
# File 'lib/moat.rb', line 8

def policy
  @policy
end

#resourceObject (readonly)

Returns the value of attribute resource.



8
9
10
# File 'lib/moat.rb', line 8

def resource
  @resource
end

#userObject (readonly)

Returns the value of attribute user.



8
9
10
# File 'lib/moat.rb', line 8

def user
  @user
end