Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
t
 
 
 
 
 
 
 
 

Build Status

Potocol

Description

The idea here is to have a "set of methods". So, you can test a class based on that set of methods. But different from roles with stubed methods it doesn't need do be "doesed" to be matched. It does create a subset but using a different syntax, and will check the methods.

Synopsis

use Protocol;

protocol Writer {
    method write { ... }
}

multi write(Writer $w) {
    $w.write
}

multi write($data) {
    say $data
}

class JustAGreeter {            # no roles, parents nor protocols declared on the class
    method write {              # it has the write method, so it attends to the protocol
        say "Hello protocol!"
    }
}

write JustAGreeter.new;         # prints: Hello protocol!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Other 100.0%