Exception: WrapperBased::RoleUnknown

Inherits:
NoMethodError
  • Object
show all
Defined in:
lib/wrapper_based/role_unknown.rb

Class Method Summary collapse

Class Method Details

.or(error) ⇒ Object



3
4
5
6
# File 'lib/wrapper_based/role_unknown.rb', line 3

def self.or(error)
  return error unless error.message =~ /^undefined method `with_(\w..)/
  new error.message.sub('undefined method', 'unknown role').sub('with_','').sub('!','')
end