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

Returns a new instance of MultipleMatchesError.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/qb/role/errors.rb', line 18

def initialize input, matches
  @input = input
  @matches = matches
  
  super <<-END
multiple roles match input #{ @input.inspect }:\

#{
  @matches.map { |role|
    "-   #{ role.to_s } (#{ role.path.to_s })"
  }.join("\n")
}

END
end

Instance Attribute Details

#inputObject

Returns the value of attribute input.



16
17
18
# File 'lib/qb/role/errors.rb', line 16

def input
  @input
end

#matchesObject

Returns the value of attribute matches.



16
17
18
# File 'lib/qb/role/errors.rb', line 16

def matches
  @matches
end