{"id":16310167,"url":"https://github.com/grinnz/class-tiny-immutable","last_synced_at":"2025-10-09T12:32:47.125Z","repository":{"id":56839345,"uuid":"97175383","full_name":"Grinnz/Class-Tiny-Immutable","owner":"Grinnz","description":"Class::Tiny::Immutable - Minimalist class construction, with read-only attributes","archived":false,"fork":false,"pushed_at":"2019-02-10T19:58:11.000Z","size":19,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T17:13:27.489Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Grinnz.png","metadata":{"files":{"readme":"README.pod","changelog":"Changes","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-14T00:16:12.000Z","updated_at":"2019-02-10T19:58:11.000Z","dependencies_parsed_at":"2022-08-29T02:52:13.103Z","dependency_job_id":null,"html_url":"https://github.com/Grinnz/Class-Tiny-Immutable","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Grinnz%2FClass-Tiny-Immutable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Grinnz%2FClass-Tiny-Immutable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Grinnz%2FClass-Tiny-Immutable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Grinnz%2FClass-Tiny-Immutable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Grinnz","download_url":"https://codeload.github.com/Grinnz/Class-Tiny-Immutable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248750127,"owners_count":21155687,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T21:24:00.273Z","updated_at":"2025-10-09T12:32:42.085Z","avatar_url":"https://github.com/Grinnz.png","language":"Perl","readme":"=pod\n\n=head1 NAME\n\nClass::Tiny::Immutable - Minimalist class construction, with read-only\nattributes\n\n=head1 SYNOPSIS\n\nIn I\u003cPerson.pm\u003e:\n\n  package Person;\n  \n  use Class::Tiny::Immutable qw( name );\n  \n  1;\n\nIn I\u003cEmployee.pm\u003e:\n\n  package Employee;\n  use parent 'Person';\n  \n  use Class::Tiny::Immutable qw( ssn ), {\n    timestamp =\u003e sub { time }   # lazy attribute with default\n  };\n  \n  1;\n\nIn I\u003cexample.pl\u003e:\n\n  use Employee;\n  \n  my $obj = Employee-\u003enew; # dies, name and ssn attributes are required\n  my $obj = Employee-\u003enew( name =\u003e \"Larry\", ssn =\u003e \"111-22-3333\" );\n  \n  my $name = $obj-\u003ename;\n  my $timestamp = $obj-\u003etimestamp;\n  \n  # no attributes can be set\n  $obj-\u003essn(\"222-33-4444\"); # dies\n  $obj-\u003etimestamp(time); # dies\n\n=head1 DESCRIPTION\n\nL\u003cClass::Tiny::Immutable\u003e is a wrapper around L\u003cClass::Tiny\u003e which makes the\ngenerated attributes read-only, and required to be set in the object\nconstructor if they do not have a lazy default defined. In other words,\nattributes are either \"lazy\" or \"required\".\n\n=head1 METHODS\n\nIn addition to methods inherited from L\u003cClass::Tiny\u003e, Class::Tiny::Immutable\ndefines the following additional introspection method:\n\n=head2 get_all_required_attributes_for\n\n  my @required = Class::Tiny::Immutable-\u003eget_all_required_attributes_for($class);\n\nReturns an unsorted list of required attributes known to Class::Tiny::Immutable\nfor a class and its superclasses.\n\n=head1 BUGS\n\nReport any issues on the public bugtracker.\n\n=head1 AUTHOR\n\nDan Book \u003cdbook@cpan.org\u003e\n\n=head1 COPYRIGHT AND LICENSE\n\nThis software is Copyright (c) 2017 by Dan Book.\n\nThis is free software, licensed under:\n\n  The Artistic License 2.0 (GPL Compatible)\n\n=head1 SEE ALSO\n\nL\u003cMoo\u003e, L\u003cMooseX::AttributeShortcuts\u003e\n\n=cut\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrinnz%2Fclass-tiny-immutable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrinnz%2Fclass-tiny-immutable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrinnz%2Fclass-tiny-immutable/lists"}