Skip to content

Instantly share code, notes, and snippets.

/-

Created August 18, 2017 06:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/9f030ca243a8c031bb0794c850f86d23 to your computer and use it in GitHub Desktop.
Save anonymous/9f030ca243a8c031bb0794c850f86d23 to your computer and use it in GitHub Desktop.
diff --git a/lib/Mojo/Base.pm b/lib/Mojo/Base.pm
index c6ea0aa50..81e67417f 100644
--- a/lib/Mojo/Base.pm
+++ b/lib/Mojo/Base.pm
@@ -259,10 +259,11 @@ spliced or tapped into) a chained set of object method calls.
my $new_class = SubClass->with_roles('+One', '+Two');
$object = $object->with_roles('+One', '+Two');
-Create a new class with one or more L<Role::Tiny> roles and return it, or
-rebless the given object into it. For roles following the naming scheme
-C<MyClass::Role::RoleName> you can use the shorthand C<+RoleName>. Note that
-role support depends on L<Role::Tiny> (2.000001+).
+Call with_class on a class or object to apply the given list of roles
+to it and return it. For objects this will actually rebless the passed
+argument as well. If the role follows name name scheme C<MyClass::Role::RoleName>
+you can use the shorthand C<+RoleName>. Note that role support depends on
+L<Role::Tiny> (2.000001+).
# Create a new class with the role "SubClass::Role::Foo" and instantiate it
my $new_class = SubClass->with_roles('+Foo');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment