Sha256: f1d2fcb4f1c4ca28c0c935a4d5ccf5ae4f85e211425deb3b6d0079d90a7df062

Contents?: true

Size: 816 Bytes

Versions: 17

Compression:

Stored size: 816 Bytes

Contents

module QB
  class Role
    # raised by `.require` when no roles match input
    class NoMatchesError < QB::Error
      attr_accessor :input
      
      def initialize input
        @input = input
        
        super "no roles match input #{ @input.inspect }"
      end
    end
    
    # raised by `.require` when multiple roles match
    class MultipleMatchesError < QB::Error
      attr_accessor :input, :matches
      
      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
    end
    
    # raised when there's bad metadata 
    class MetadataError < QB::Error
    end
  end # Role
end # QB

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
qb-0.3.1 lib/qb/role/errors.rb
qb-0.1.88 lib/qb/role/errors.rb
qb-0.1.87 lib/qb/role/errors.rb
qb-0.1.86 lib/qb/role/errors.rb
qb-0.1.85 lib/qb/role/errors.rb
qb-0.1.84 lib/qb/role/errors.rb
qb-0.1.83 lib/qb/role/errors.rb
qb-0.1.82 lib/qb/role/errors.rb
qb-0.1.81 lib/qb/role/errors.rb
qb-0.1.80 lib/qb/role/errors.rb
qb-0.1.79 lib/qb/role/errors.rb
qb-0.1.78 lib/qb/role/errors.rb
qb-0.1.77 lib/qb/role/errors.rb
qb-0.1.76 lib/qb/role/errors.rb
qb-0.1.75 lib/qb/role/errors.rb
qb-0.1.74 lib/qb/role/errors.rb
qb-0.1.73 lib/qb/role/errors.rb