Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vendethiel/hydrate6
Hydrate Perl 6 module
https://github.com/vendethiel/hydrate6
hydrate perl6 raku
Last synced: 2 months ago
JSON representation
Hydrate Perl 6 module
- Host: GitHub
- URL: https://github.com/vendethiel/hydrate6
- Owner: vendethiel
- Created: 2015-11-14T20:25:44.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-01-17T12:12:41.000Z (almost 5 years ago)
- Last Synced: 2024-10-11T21:40:48.474Z (3 months ago)
- Topics: hydrate, perl6, raku
- Language: Perl 6
- Homepage:
- Size: 5.86 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Hydrate
=======Hydrate is a small module to "hydrate" (ORM speak) your object hierarchy, from a bunch of hashes.
Example:
```perl6
use Hydrate;my class Mes {
has Int $.height;
has Int $.width;
}my class Cont {
has Str $.name is required;
has Mes @.mesures;
has %.data; # optional
}say hydrate(Cont, {
name => "Some mesures",
mesures => [
{height => 50, width => 50},
{height => 150, width => 75},
{height => 200, width => 200},
]
})
```Result:
```perl6
Cont.new(
name => "Some mesures",
mesures => Array[Mes].new(
Mes.new(height => 50, width => 50),
Mes.new(height => 150, width => 75),
Mes.new(height => 200, width => 200)
),
data => {},
)
```