1. class CompUnit::DependencySpecification {
  2. has Str:D $.short-name is required;
  3. has Int:D $.source-line-number = 0;
  4. has Str:D $.from = 'Perl6';
  5. has $.version-matcher = True;
  6. has $.auth-matcher = True;
  7. has $.api-matcher = True;
  8. method Str(CompUnit::DependencySpecification:D:) {
  9. join '', $.short-name,
  10. ($.version-matcher//True) ~~ Bool ?? '' !! ":ver<$.version-matcher>",
  11. ($.auth-matcher //True) ~~ Bool ?? '' !! ":auth<$.auth-matcher>",
  12. ($.api-matcher //True) ~~ Bool ?? '' !! ":api<$.api-matcher>";
  13. }
  14. }