Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/songmu/class-data-lite
https://github.com/songmu/class-data-lite
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/songmu/class-data-lite
- Owner: Songmu
- License: other
- Created: 2019-01-27T15:19:17.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-28T12:37:01.000Z (almost 6 years ago)
- Last Synced: 2024-10-11T21:09:54.069Z (27 days ago)
- Language: Perl
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
# NAME
Class::Data::Lite - a minimalistic class accessors
# SYNOPSIS
package MyPackage;
use Class::Data::Lite (
rw => {
readwrite => 'rw',
},
ro => {
readonly => 'ro',
},
);
package main;
print(MyPackage->readwrite); #=> rw# DESCRIPTION
Class::Data::Lite is a minimalistic implement for class accessors.
There is no inheritance and fast.# THE USE STATEMENT
The use statement (i.e. the `import` function) of the module takes a single
hash as an argument that specifies the types and the names of the properties.
Recognises the following keys.- `rw` => (\\@name\_of\_the\_properties|\\%name\_of\_the\_properties\_and\_values)
creates a read / write class accessor for the name of the properties passed
through as an arrayref or hashref.- `ro` => (\\@name\_of\_the\_properties|\\%name\_of\_the\_properties\_and\_values)
creates a read-only class accessor for the name of the properties passed
through as an arrayref or hashref.# BENCHMARK
It is faster than Class::Data::Inheritance. See `eg/bench.pl`.
Rate Class::Data::Inheritable Class::Data::Lite
Class::Data::Inheritable 2619253/s -- -38%
Class::Data::Lite 4191169/s 60% --# SEE ALSO
[Class::Accessor::Lite](https://metacpan.org/pod/Class::Accessor::Lite), [Class::Data::Inheritance](https://metacpan.org/pod/Class::Data::Inheritance)
# LICENSE
Copyright (C) Songmu.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.# AUTHOR
Songmu