Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: b4648b73e6
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (19 sloc) 0.572 kB
use v6;
role ABC::Duration {
has $.ticks;
multi sub duration-from-parse($top) is export {
ABC::Duration.new(:ticks(($top // 1).Int));
}
multi sub duration-from-parse($top, $bottom) is export {
ABC::Duration.new(:ticks(($top // 1).Int / ($bottom // 2).Int));
}
our method duration-to-str() {
given $.ticks {
when 1 { ""; }
when 1/2 { "/"; }
when Int { .Str; }
when Rat { .perl; }
die "Duration must be Int or Rat, but it's { .WHAT }";
}
}
}
Jump to Line
Something went wrong with that request. Please try again.