Skip to content

Instantly share code, notes, and snippets.

@colomon
Created April 19, 2012 01:53
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save colomon/2417825 to your computer and use it in GitHub Desktop.
use v6;
role ABC::Duration {
has $.ticks;
our multi sub duration-from-parse($top) is export {
ABC::Duration.new(:ticks(($top // 1).Int));
}
our multi sub duration-from-parse($top, $bottom) is export {
ABC::Duration.new(:ticks(($top // 1).Int / ($bottom // 2).Int));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment