Exception: QB::Role::MultipleMatchesError

Inherits:
UserInputError show all
Defined in:
lib/qb/role/errors.rb

Overview

raised by .require when multiple roles match

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input, matches) ⇒ MultipleMatchesError



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/qb/role/errors.rb', line 28

def initialize input, matches
  @input = input
  @matches = matches
  
  super binding.erb "    multiple roles match input <%= @input.inspect %>:\n    \n    <% @matches.map do |role| %>\n      -   <%= role.to_s %> (<%= role.path.to_s %>)\n    <% end %>\n    \n  END\nend\n"

Instance Attribute Details

#inputObject

Returns the value of attribute input.



26
27
28
# File 'lib/qb/role/errors.rb', line 26

def input
  @input
end

#matchesObject

Returns the value of attribute matches.



26
27
28
# File 'lib/qb/role/errors.rb', line 26

def matches
  @matches
end