Skip to content

Commit

Permalink
changed subclassing hints a little
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 24, 2012
1 parent 257ca94 commit b827e4c
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 28 deletions.
8 changes: 4 additions & 4 deletions lib/Mojo.pm
Expand Up @@ -172,10 +172,10 @@ Application configuration.
$app->handler($tx);
The handler is the main entry point to your application or framework and
meant to be overloaded in a subclass. It will be called for each new
transaction, which will usually be a L<Mojo::Transaction::HTTP> or
L<Mojo::Transaction::WebSocket> object.
The handler is the main entry point to your application or framework and will
be called for each new transaction, which will usually be a
L<Mojo::Transaction::HTTP> or L<Mojo::Transaction::WebSocket> object. Meant
to be overloaded in a subclass.
sub handler {
my ($self, $tx) = @_;
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Asset.pm
Expand Up @@ -97,7 +97,7 @@ Size of asset data in bytes, meant to be overloaded in a subclass.
my $string = $asset->slurp;
Read all asset data at once, meant to be overloaded in a subclass.
Read all asset data at once. Meant to be overloaded in a subclass.
=head1 SEE ALSO
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Command.pm
Expand Up @@ -336,7 +336,7 @@ relative file.
$command->run;
$command->run(@ARGV);
Run command, meant to be overloaded in a subclass.
Run command. Meant to be overloaded in a subclass.
=head2 C<write_file>
Expand Down
6 changes: 3 additions & 3 deletions lib/Mojo/Content.pm
Expand Up @@ -494,14 +494,14 @@ implements the following new ones.
my $success = $content->body_contains('foo bar baz');
Check if content contains a specific string, meant to be overloaded in a
Check if content contains a specific string. Meant to be overloaded in a
subclass.
=head2 C<body_size>
my $size = $content->body_size;
Content size in bytes, meant to be overloaded in a subclass.
Content size in bytes. Meant to be overloaded in a subclass.
=head2 C<boundary>
Expand Down Expand Up @@ -543,7 +543,7 @@ Generate dynamic content.
my $chunk = $content->get_body_chunk(0);
Get a chunk of content starting from a specfic position, meant to be
Get a chunk of content starting from a specfic position. Meant to be
overloaded in a subclass.
=head2 C<get_header_chunk>
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Cookie.pm
Expand Up @@ -117,13 +117,13 @@ following new ones.
my $cookies = $cookie->parse($string);
Parse cookies, meant to be overloaded in a subclass.
Parse cookies. Meant to be overloaded in a subclass.
=head2 C<to_string>
my $string = $cookie->to_string;
Render cookie, meant to be overloaded in a subclass.
Render cookie. Meant to be overloaded in a subclass.
=head1 SEE ALSO
Expand Down
18 changes: 9 additions & 9 deletions lib/Mojo/Reactor.pm
Expand Up @@ -103,7 +103,7 @@ L<Mojo::Reactor::Poll>.
$reactor = $reactor->io($handle => sub {...});
Watch handle for I/O events, invoking the callback whenever handle becomes
readable or writable, meant to be overloaded in a subclass.
readable or writable. Meant to be overloaded in a subclass.
# Callback will be invoked twice if handle becomes readable and writable
$reactor->io($handle => sub {
Expand All @@ -122,22 +122,22 @@ tainted sockets.
my $success = $reactor->is_running;
Check if reactor is running, meant to be overloaded in a subclass.
Check if reactor is running. Meant to be overloaded in a subclass.
=head2 C<one_tick>
$reactor->one_tick;
Run reactor until at least one event has been handled or no events are being
watched anymore, meant to be overloaded in a subclass. Note that this method
can recurse back into the reactor, so you need to be careful.
watched anymore. Note that this method can recurse back into the reactor, so
you need to be careful. Meant to be overloaded in a subclass.
=head2 C<recurring>
my $id = $reactor->recurring(0.25 => sub {...});
Create a new recurring timer, invoking the callback repeatedly after a given
amount of time in seconds, meant to be overloaded in a subclass.
amount of time in seconds. Meant to be overloaded in a subclass.
# Invoke as soon as possible
$reactor->recurring(0 => sub { say 'Reactor tick.' });
Expand All @@ -147,28 +147,28 @@ amount of time in seconds, meant to be overloaded in a subclass.
my $success = $reactor->remove($handle);
my $success = $reactor->remove($id);
Remove handle or timer, meant to be overloaded in a subclass.
Remove handle or timer. Meant to be overloaded in a subclass.
=head2 C<start>
$reactor->start;
Start watching for I/O and timer events, this will block until C<stop> is
called or no events are being watched anymore, meant to be overloaded in a
called or no events are being watched anymore. Meant to be overloaded in a
subclass.
=head2 C<stop>
$reactor->stop;
Stop watching for I/O and timer events, meant to be overloaded in a subclass.
Stop watching for I/O and timer events. Meant to be overloaded in a subclass.
=head2 C<timer>
my $id = $reactor->timer(0.5 => sub {...});
Create a new timer, invoking the callback after a given amount of time in
seconds, meant to be overloaded in a subclass.
seconds. Meant to be overloaded in a subclass.
# Invoke as soon as possible
$reactor->timer(0 => sub { say 'Next tick.' });
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Server.pm
Expand Up @@ -157,7 +157,7 @@ Load application from script.
$server->run;
Run server, meant to be overloaded in a subclass.
Run server. Meant to be overloaded in a subclass.
=head1 SEE ALSO
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojo/Transaction.pm
Expand Up @@ -196,13 +196,13 @@ Transaction closed.
$tx->client_read($chunk);
Read and process client data, meant to be overloaded in a subclass.
Read and process client data. Meant to be overloaded in a subclass.
=head2 C<client_write>
my $chunk = $tx->client_write;
Write client data, meant to be overloaded in a subclass.
Write client data. Meant to be overloaded in a subclass.
=head2 C<connection>
Expand Down Expand Up @@ -252,13 +252,13 @@ Transaction closed.
$tx->server_read($chunk);
Read and process server data, meant to be overloaded in a subclass.
Read and process server data. Meant to be overloaded in a subclass.
=head2 C<server_write>
my $chunk = $tx->server_write;
Write server data, meant to be overloaded in a subclass.
Write server data. Meant to be overloaded in a subclass.
=head2 C<success>
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious.pm
Expand Up @@ -617,8 +617,8 @@ application.
$app->startup;
This is your main hook into the application and meant to be overloaded in a
subclass, it will be called at application startup.
This is your main hook into the application, it will be called at application
startup. Meant to be overloaded in a subclass.
sub startup {
my $self = shift;
Expand Down
2 changes: 1 addition & 1 deletion t/mojo/dom.t
Expand Up @@ -483,7 +483,7 @@ is "$dom", $yadis, 'successful roundtrip';
# Result and iterator order
$dom = Mojo::DOM->new->parse('<a><b>1</b></a><b>2</b><b>3</b>');
my @numbers;
$dom->find("b")->each(sub { push @numbers, pop, shift->text });
$dom->find('b')->each(sub { push @numbers, pop, shift->text });
is_deeply \@numbers, [1, 1, 2, 2, 3, 3], 'right order';

# Attributes on multiple lines
Expand Down

0 comments on commit b827e4c

Please sign in to comment.