role Metamodel::Versioning

Metaobjects that support versioning

role Metamodel::Versioning { ... }

Metamodel role for (optionally) versioning metaobjects.

When you declare a type, you can pass it a version, author, and/or API and get them, like so:

class Versioned:ver<0.0.1>:auth<github:Kaiepi>:api<1> { }
 
say Versioned.^ver;  # OUTPUT: «v0.0.1␤» 
say Versioned.^auth# OUTPUT: «github:Kaiepi␤» 
say Versioned.^api;  # OUTPUT: «1␤» 

This is roughly equivalent to the following, which also sets them explicitly:

BEGIN {
    class Versioned { }
    Versioned.^set_ver:  v0.0.1;
    Versioned.^set_auth: 'github:Kaiepi';
    Versioned.^set_api:  <1>;
}
 
say Versioned.^ver;  # OUTPUT: «v0.0.1␤» 
say Versioned.^auth# OUTPUT: «github:Kaiepi␤» 
say Versioned.^api;  # OUTPUT: «1␤» 

Methods

method ver

method ver($obj)

Returns the version of the metaobject, if any, otherwise returns Mu.

method auth

method auth($obj)

Returns the author of the metaobject, if any, otherwise returns an empty string.

method api

method api($obj)

Returns the API of the metaobject, if any, otherwise returns an empty string.

method set_ver

method set_ver($obj$ver)

Sets the version of the metaobject.

method set_auth

method set_auth($obj$auth)

Sets the author of the metaobject.

method set_api

method set_api($obj$api)

Sets the API of the metaobject.

Type Graph

Type relations for Metamodel::Versioning
perl6-type-graph Metamodel::Versioning Metamodel::Versioning Mu Mu Any Any Any->Mu Metamodel::Naming Metamodel::Naming Metamodel::Documenting Metamodel::Documenting Metamodel::MethodContainer Metamodel::MethodContainer Metamodel::PrivateMethodContainer Metamodel::PrivateMethodContainer Metamodel::MultiMethodContainer Metamodel::MultiMethodContainer Metamodel::AttributeContainer Metamodel::AttributeContainer Metamodel::RoleContainer Metamodel::RoleContainer Metamodel::MultipleInheritance Metamodel::MultipleInheritance Metamodel::Stashing Metamodel::Stashing Metamodel::TypePretense Metamodel::TypePretense Metamodel::RolePunning Metamodel::RolePunning Metamodel::ParametricRoleHOW Metamodel::ParametricRoleHOW Metamodel::ParametricRoleHOW->Metamodel::Versioning Metamodel::ParametricRoleHOW->Any Metamodel::ParametricRoleHOW->Metamodel::Naming Metamodel::ParametricRoleHOW->Metamodel::Documenting Metamodel::ParametricRoleHOW->Metamodel::MethodContainer Metamodel::ParametricRoleHOW->Metamodel::PrivateMethodContainer Metamodel::ParametricRoleHOW->Metamodel::MultiMethodContainer Metamodel::ParametricRoleHOW->Metamodel::AttributeContainer Metamodel::ParametricRoleHOW->Metamodel::RoleContainer Metamodel::ParametricRoleHOW->Metamodel::MultipleInheritance Metamodel::ParametricRoleHOW->Metamodel::Stashing Metamodel::ParametricRoleHOW->Metamodel::TypePretense Metamodel::ParametricRoleHOW->Metamodel::RolePunning Metamodel::MethodDelegation Metamodel::MethodDelegation Metamodel::ModuleHOW Metamodel::ModuleHOW Metamodel::ModuleHOW->Metamodel::Versioning Metamodel::ModuleHOW->Any Metamodel::ModuleHOW->Metamodel::Naming Metamodel::ModuleHOW->Metamodel::Documenting Metamodel::ModuleHOW->Metamodel::Stashing Metamodel::ModuleHOW->Metamodel::TypePretense Metamodel::ModuleHOW->Metamodel::MethodDelegation Metamodel::Finalization Metamodel::Finalization Metamodel::DefaultParent Metamodel::DefaultParent Metamodel::C3MRO Metamodel::C3MRO Metamodel::MROBasedMethodDispatch Metamodel::MROBasedMethodDispatch Metamodel::MROBasedTypeChecking Metamodel::MROBasedTypeChecking Metamodel::Trusting Metamodel::Trusting Metamodel::BUILDPLAN Metamodel::BUILDPLAN Metamodel::Mixins Metamodel::Mixins Metamodel::BoolificationProtocol Metamodel::BoolificationProtocol Metamodel::ClassHOW Metamodel::ClassHOW Metamodel::ClassHOW->Metamodel::Versioning Metamodel::ClassHOW->Any Metamodel::ClassHOW->Metamodel::Naming Metamodel::ClassHOW->Metamodel::Documenting Metamodel::ClassHOW->Metamodel::MethodContainer Metamodel::ClassHOW->Metamodel::PrivateMethodContainer Metamodel::ClassHOW->Metamodel::MultiMethodContainer Metamodel::ClassHOW->Metamodel::AttributeContainer Metamodel::ClassHOW->Metamodel::RoleContainer Metamodel::ClassHOW->Metamodel::MultipleInheritance Metamodel::ClassHOW->Metamodel::Stashing Metamodel::ClassHOW->Metamodel::Finalization Metamodel::ClassHOW->Metamodel::DefaultParent Metamodel::ClassHOW->Metamodel::C3MRO Metamodel::ClassHOW->Metamodel::MROBasedMethodDispatch Metamodel::ClassHOW->Metamodel::MROBasedTypeChecking Metamodel::ClassHOW->Metamodel::Trusting Metamodel::ClassHOW->Metamodel::BUILDPLAN Metamodel::ClassHOW->Metamodel::Mixins Metamodel::ClassHOW->Metamodel::BoolificationProtocol Metamodel::NativeHOW Metamodel::NativeHOW Metamodel::NativeHOW->Metamodel::Versioning Metamodel::NativeHOW->Any Metamodel::NativeHOW->Metamodel::Naming Metamodel::NativeHOW->Metamodel::Documenting Metamodel::NativeHOW->Metamodel::MultipleInheritance Metamodel::NativeHOW->Metamodel::Stashing Metamodel::NativeHOW->Metamodel::C3MRO Metamodel::NativeHOW->Metamodel::MROBasedMethodDispatch Metamodel::NativeHOW->Metamodel::MROBasedTypeChecking Metamodel::ConcreteRoleHOW Metamodel::ConcreteRoleHOW Metamodel::ConcreteRoleHOW->Metamodel::Versioning Metamodel::ConcreteRoleHOW->Any Metamodel::ConcreteRoleHOW->Metamodel::Naming Metamodel::ConcreteRoleHOW->Metamodel::MethodContainer Metamodel::ConcreteRoleHOW->Metamodel::PrivateMethodContainer Metamodel::ConcreteRoleHOW->Metamodel::MultiMethodContainer Metamodel::ConcreteRoleHOW->Metamodel::AttributeContainer Metamodel::ConcreteRoleHOW->Metamodel::RoleContainer Metamodel::ConcreteRoleHOW->Metamodel::MultipleInheritance

Expand above chart