Sha256: bc6e28d580bae29381db569ff0212d514cd77455644fc116211fd7e403e977e2

Contents?: true

Size: 839 Bytes

Versions: 11

Compression:

Stored size: 839 Bytes

Contents

module QB
  class Role
    # raised by `.require` when no roles match input
    class NoMatchesError < QB::UserInputError
      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::UserInputError
      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::StateError
    end
  end # Role
end # QB

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
qb-0.3.12 lib/qb/role/errors.rb
qb-0.3.11 lib/qb/role/errors.rb
qb-0.3.10 lib/qb/role/errors.rb
qb-0.3.9 lib/qb/role/errors.rb
qb-0.3.8 lib/qb/role/errors.rb
qb-0.3.7 lib/qb/role/errors.rb
qb-0.3.6 lib/qb/role/errors.rb
qb-0.3.5 lib/qb/role/errors.rb
qb-0.3.4 lib/qb/role/errors.rb
qb-0.3.3 lib/qb/role/errors.rb
qb-0.3.2 lib/qb/role/errors.rb