GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
OpenXPKI::Client::UI::Response::DTO(3) User Contributed Perl Documentation OpenXPKI::Client::UI::Response::DTO(3)

To define a new data transfer object (DTO) simply say:

    package OpenXPKI::Client::UI::Response::MyData;
    use OpenXPKI::Client::UI::Response::DTO;
    has 'message' => (
        is => 'rw',
        isa => 'Str',
    );
    has_dto 'menu' => (
        documentation => 'structure',
        class => 'OpenXPKI::Client::UI::Response::Menu',
    );

This will modify your package as follows:

  • imports "Moose" (i.e. adds "use Moose;" so you don't have to do it)
  • provides the "has_dto" keyword to define nested DTOs
  • applies the Moose role OpenXPKI::Client::UI::Response::DTORole

Static method: shortcut to define DTO attributes in Moose with less overhead:

    has_dto 'menu' => (
        documentation => 'structure', # key name in result hash will be "structure" instead of "menu"
        class => 'OpenXPKI::Client::UI::Response::Menu',
    );

is equivalent to:

    has 'menu'=> (
        documentation => 'structure',
        is => 'rw',
        isa => 'OpenXPKI::Client::UI::Response::Menu',
        default => sub { OpenXPKI::Client::UI::Response::Menu->new },
        lazy => 1,
    );
2025-07-15 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.