Venus::Role::Printable
Printable Role
Printable Role for Perl 5
method: print method: print_json method: print_pretty method: print_string method: print_yaml method: say method: say_json method: say_pretty method: say_string method: say_yaml
package Example;
use Venus::Class;
with 'Venus::Role::Dumpable';
with 'Venus::Role::Printable';
attr 'test';
sub execute {
return [@_];
}
sub printer {
return [@_];
}
package main;
my $example = Example->new(test => 123);
# $example->say;
This package provides a mechanism for outputting (printing) objects or the return value of a dispatched method call to STDOUT.
The print method prints a stringified representation of the underlying data.
print(any @data) (any)
{ since => '0.01', }
=example-1 print
package main;
my $example = Example->new(test => 123);
my $print = $example->print;
# bless({test => 123}, 'Example')
# 1
The print_json method prints a JSON representation of the underlying data. This method supports dispatching, i.e. providing a method name and arguments whose return value will be acted on by this method.
print_json(string | coderef $method, any @args) (any)
{ since => '2.91', }
=example-1 print_json
package main;
my $example = Example->new(test => 123);
my $print_json = $example->print_json;
# "{\"test\": 123}"
The print_pretty method prints a stringified human-readable representation of the underlying data.
print_pretty(any @data) (any)
{ since => '0.01', }
=example-1 print_pretty
package main;
my $example = Example->new(test => 123);
my $print_pretty = $example->print_pretty;
# bless({ test => 123 }, 'Example')
# 1
The print_string method prints a string representation of the underlying data without using a dump. This method supports dispatching, i.e. providing a method name and arguments whose return value will be acted on by this method.
print_string(string | coderef $method, any @args) (any)
{ since => '0.09', }
=example-1 print_string
package main;
my $example = Example->new(test => 123);
my $print_string = $example->print_string;
# 'Example'
# 1
The print_yaml method prints a YAML representation of the underlying data. This method supports dispatching, i.e. providing a method name and arguments whose return value will be acted on by this method.
print_yaml(string | coderef $method, any @args) (any)
{ since => '2.91', }
=example-1 print_yaml
package main;
my $example = Example->new(test => 123);
my $print_yaml = $example->print_yaml;
# "---\ntest: 123"
The say method prints a stringified representation of the underlying data, with a trailing newline.
say(any @data) (any)
{ since => '0.01', }
=example-1 say
package main;
my $example = Example->new(test => 123);
my $say = $example->say;
# bless({test => 123}, 'Example')\n
# 1
The say_json method prints a JSON representation of the underlying data. This method supports dispatching, i.e. providing a method name and arguments whose return value will be acted on by this method, with a trailing newline.
say_json(string | coderef $method, any @args) (any)
{ since => '2.91', }
=example-1 say_json
package main;
my $example = Example->new(test => 123);
my $say_json = $example->say_json;
# "{\"test\": 123}\n"
The say_pretty method prints a stringified human-readable representation of the underlying data, with a trailing newline.
say_pretty(any @data) (any)
{ since => '0.01', }
=example-1 say_pretty
package main;
my $example = Example->new(test => 123);
my $say_pretty = $example->say_pretty;
# bless({ test => 123 }, 'Example')\n
# 1
The say_string method prints a string representation of the underlying data without using a dump, with a trailing newline. This method supports dispatching, i.e. providing a method name and arguments whose return value will be acted on by this method.
say_string(string | coderef $method, any @args) (any)
{ since => '0.09', }
=example-1 say_string
package main;
my $example = Example->new(test => 123);
my $say_string = $example->say_string;
# "Example\n"
# 1
The say_yaml method prints a YAML representation of the underlying data. This method supports dispatching, i.e. providing a method name and arguments whose return value will be acted on by this method, with a trailing newline.
say_yaml(string | coderef $method, any @args) (any)
{ since => '2.91', }
=example-1 say_yaml
package main;
my $example = Example->new(test => 123);
my $say_yaml = $example->say_yaml;
# "---\ntest: 123\n"
t/Venus.t: present: authors t/Venus.t: present: license
45 POD Errors
The following errors were encountered while parsing the POD:
- Around line 14:
Unknown directive: =name
- Around line 22:
Unknown directive: =tagline
- Around line 30:
Unknown directive: =abstract
- Around line 38:
Unknown directive: =includes
- Around line 55:
Unknown directive: =synopsis
- Around line 91:
Unknown directive: =description
- Around line 100:
Unknown directive: =method
- Around line 104:
Unknown directive: =signature
- Around line 108:
Unknown directive: =metadata
- Around line 148:
=cut found outside a pod block. Skipping to next block.
- Around line 158:
Unknown directive: =method
- Around line 164:
Unknown directive: =signature
- Around line 168:
Unknown directive: =metadata
- Around line 207:
=cut found outside a pod block. Skipping to next block.
- Around line 220:
Unknown directive: =method
- Around line 225:
Unknown directive: =signature
- Around line 229:
Unknown directive: =metadata
- Around line 274:
=cut found outside a pod block. Skipping to next block.
- Around line 284:
Unknown directive: =method
- Around line 290:
Unknown directive: =signature
- Around line 294:
Unknown directive: =metadata
- Around line 322:
Unknown directive: =method
- Around line 328:
Unknown directive: =signature
- Around line 332:
Unknown directive: =metadata
- Around line 371:
=cut found outside a pod block. Skipping to next block.
- Around line 384:
Unknown directive: =method
- Around line 389:
Unknown directive: =signature
- Around line 393:
Unknown directive: =metadata
- Around line 433:
=cut found outside a pod block. Skipping to next block.
- Around line 443:
Unknown directive: =method
- Around line 449:
Unknown directive: =signature
- Around line 453:
Unknown directive: =metadata
- Around line 492:
=cut found outside a pod block. Skipping to next block.
- Around line 505:
Unknown directive: =method
- Around line 510:
Unknown directive: =signature
- Around line 514:
Unknown directive: =metadata
- Around line 559:
=cut found outside a pod block. Skipping to next block.
- Around line 569:
Unknown directive: =method
- Around line 576:
Unknown directive: =signature
- Around line 580:
Unknown directive: =metadata
- Around line 608:
Unknown directive: =method
- Around line 614:
Unknown directive: =signature
- Around line 618:
Unknown directive: =metadata
- Around line 657:
=cut found outside a pod block. Skipping to next block.
- Around line 670:
Unknown directive: =partials