Exception: Banken::NotAuthorizedError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ NotAuthorizedError

Returns a new instance of NotAuthorizedError.



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/banken/error.rb', line 7

def initialize(options={})
  if options.is_a? String
    message = options
  else
    @controller = options[:controller]
    @query      = options[:query]
    @loyalty    = options[:loyalty]

    message = options.fetch(:message) { "not allowed to #{query} of #{controller} by #{loyalty.inspect}" }
  end

  super(message)
end

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.



5
6
7
# File 'lib/banken/error.rb', line 5

def controller
  @controller
end

#loyaltyObject (readonly)

Returns the value of attribute loyalty.



5
6
7
# File 'lib/banken/error.rb', line 5

def loyalty
  @loyalty
end

#queryObject (readonly)

Returns the value of attribute query.



5
6
7
# File 'lib/banken/error.rb', line 5

def query
  @query
end