| 1 | package Nano::Types; | ||
| 2 | |||
| 3 | use 5.014; | ||
| 4 | |||
| 5 | use strict; | ||
| 6 | use warnings; | ||
| 7 | |||
| 8 | use Data::Object::Types::Keywords; | ||
| 9 | |||
| 10 | use base 'Data::Object::Types::Library'; | ||
| 11 | |||
| 12 | extends 'Types::Standard'; | ||
| 13 | |||
| 14 | our $VERSION = '0.05'; # VERSION | ||
| 15 | |||
| 16 | register { | ||
| 17 | name => 'Env', | ||
| 18 | parent => 'Object', | ||
| 19 | validation => is_instance_of('Nano::Env'), | ||
| 20 | }; | ||
| 21 | |||
| 22 | register { | ||
| 23 | name => 'Nano', | ||
| 24 | parent => 'Object', | ||
| 25 | validation => is_instance_of('Nano'), | ||
| 26 | }; | ||
| 27 | |||
| 28 | register { | ||
| 29 | name => 'Node', | ||
| 30 | parent => 'Object', | ||
| 31 | validation => is_instance_of('Nano::Node'), | ||
| 32 | }; | ||
| 33 | |||
| 34 | register { | ||
| 35 | name => 'Nodes', | ||
| 36 | parent => 'Object', | ||
| 37 | validation => is_instance_of('Nano::Nodes'), | ||
| 38 | }; | ||
| 39 | |||
| 40 | register { | ||
| 41 | name => 'Search', | ||
| 42 | parent => 'Object', | ||
| 43 | validation => is_instance_of('Nano::Search'), | ||
| 44 | }; | ||
| 45 | |||
| 46 | register { | ||
| 47 | name => 'KeyVal', | ||
| 48 | parent => 'Object', | ||
| 49 | validation => is_instance_of('Zing::KeyVal'), | ||
| 50 | }; | ||
| 51 | |||
| 52 | register { | ||
| 53 | name => 'Table', | ||
| 54 | parent => 'Object', | ||
| 55 | validation => is_instance_of('Zing::Table'), | ||
| 56 | }; | ||
| 57 | |||
| 58 | 1; | ||
| 59 | |||
| 60 | =encoding utf8 | ||
| 61 | |||
| 62 | =head1 NAME | ||
| 63 | |||
| 64 | Nano::Types - Type Library | ||
| 65 | |||
| 66 | =cut | ||
| 67 | |||
| 68 | =head1 ABSTRACT | ||
| 69 | |||
| 70 | Type Library | ||
| 71 | |||
| 72 | =cut | ||
| 73 | |||
| 74 | =head1 SYNOPSIS | ||
| 75 | |||
| 76 | package main; | ||
| 77 | |||
| 78 | use Nano::Types; | ||
| 79 | |||
| 80 | 1; | ||
| 81 | |||
| 82 | =cut | ||
| 83 | |||
| 84 | =head1 DESCRIPTION | ||
| 85 | |||
| 86 | This package provides type constraints for the L<Nano> object persistence | ||
| 87 | framework. | ||
| 88 | |||
| 89 | =cut | ||
| 90 | |||
| 91 | =head1 LIBRARIES | ||
| 92 | |||
| 93 | This package uses type constraints from: | ||
| 94 | |||
| 95 | L<Types::Standard> | ||
| 96 | |||
| 97 | =cut | ||
| 98 | |||
| 99 | =head1 CONSTRAINTS | ||
| 100 | |||
| 101 | This package declares the following type constraints: | ||
| 102 | |||
| 103 | =cut | ||
| 104 | |||
| 105 | =head2 env | ||
| 106 | |||
| 107 | Env | ||
| 108 | |||
| 109 | This type is defined in the L<Nano::Types> library. | ||
| 110 | |||
| 111 | =over 4 | ||
| 112 | |||
| 113 | =item env parent | ||
| 114 | |||
| 115 | Object | ||
| 116 | |||
| 117 | =back | ||
| 118 | |||
| 119 | =over 4 | ||
| 120 | |||
| 121 | =item env composition | ||
| 122 | |||
| 123 | InstanceOf["Nano::Env"] | ||
| 124 | |||
| 125 | =back | ||
| 126 | |||
| 127 | =over 4 | ||
| 128 | |||
| 129 | =item env example #1 | ||
| 130 | |||
| 131 | # given: synopsis | ||
| 132 | |||
| 133 | use Nano::Env; | ||
| 134 | |||
| 135 | my $env = Nano::Env->new; | ||
| 136 | |||
| 137 | =back | ||
| 138 | |||
| 139 | =cut | ||
| 140 | |||
| 141 | =head2 keyval | ||
| 142 | |||
| 143 | KeyVal | ||
| 144 | |||
| 145 | This type is defined in the L<Nano::Types> library. | ||
| 146 | |||
| 147 | =over 4 | ||
| 148 | |||
| 149 | =item keyval parent | ||
| 150 | |||
| 151 | Object | ||
| 152 | |||
| 153 | =back | ||
| 154 | |||
| 155 | =over 4 | ||
| 156 | |||
| 157 | =item keyval composition | ||
| 158 | |||
| 159 | InstanceOf["Zing::KeyVal"] | ||
| 160 | |||
| 161 | =back | ||
| 162 | |||
| 163 | =over 4 | ||
| 164 | |||
| 165 | =item keyval example #1 | ||
| 166 | |||
| 167 | # given: synopsis | ||
| 168 | |||
| 169 | use Zing::KeyVal; | ||
| 170 | |||
| 171 | my $domain = Zing::KeyVal->new(name => 'user-12345'); | ||
| 172 | |||
| 173 | =back | ||
| 174 | |||
| 175 | =cut | ||
| 176 | |||
| 177 | =head2 nano | ||
| 178 | |||
| 179 | Nano | ||
| 180 | |||
| 181 | This type is defined in the L<Nano::Types> library. | ||
| 182 | |||
| 183 | =over 4 | ||
| 184 | |||
| 185 | =item nano parent | ||
| 186 | |||
| 187 | Object | ||
| 188 | |||
| 189 | =back | ||
| 190 | |||
| 191 | =over 4 | ||
| 192 | |||
| 193 | =item nano composition | ||
| 194 | |||
| 195 | InstanceOf["Nano"] | ||
| 196 | |||
| 197 | =back | ||
| 198 | |||
| 199 | =over 4 | ||
| 200 | |||
| 201 | =item nano example #1 | ||
| 202 | |||
| 203 | # given: synopsis | ||
| 204 | |||
| 205 | use Nano; | ||
| 206 | |||
| 207 | my $nano = Nano->new; | ||
| 208 | |||
| 209 | =back | ||
| 210 | |||
| 211 | =cut | ||
| 212 | |||
| 213 | =head2 node | ||
| 214 | |||
| 215 | Node | ||
| 216 | |||
| 217 | This type is defined in the L<Nano::Types> library. | ||
| 218 | |||
| 219 | =over 4 | ||
| 220 | |||
| 221 | =item node parent | ||
| 222 | |||
| 223 | Object | ||
| 224 | |||
| 225 | =back | ||
| 226 | |||
| 227 | =over 4 | ||
| 228 | |||
| 229 | =item node composition | ||
| 230 | |||
| 231 | InstanceOf["Nano::Node"] | ||
| 232 | |||
| 233 | =back | ||
| 234 | |||
| 235 | =over 4 | ||
| 236 | |||
| 237 | =item node example #1 | ||
| 238 | |||
| 239 | # given: synopsis | ||
| 240 | |||
| 241 | use Nano::Node; | ||
| 242 | |||
| 243 | my $node = Nano::Node->new; | ||
| 244 | |||
| 245 | =back | ||
| 246 | |||
| 247 | =cut | ||
| 248 | |||
| 249 | =head2 nodes | ||
| 250 | |||
| 251 | Nodes | ||
| 252 | |||
| 253 | This type is defined in the L<Nano::Types> library. | ||
| 254 | |||
| 255 | =over 4 | ||
| 256 | |||
| 257 | =item nodes parent | ||
| 258 | |||
| 259 | Object | ||
| 260 | |||
| 261 | =back | ||
| 262 | |||
| 263 | =over 4 | ||
| 264 | |||
| 265 | =item nodes composition | ||
| 266 | |||
| 267 | InstanceOf["Nano::Nodes"] | ||
| 268 | |||
| 269 | =back | ||
| 270 | |||
| 271 | =over 4 | ||
| 272 | |||
| 273 | =item nodes example #1 | ||
| 274 | |||
| 275 | # given: synopsis | ||
| 276 | |||
| 277 | use Nano::Nodes; | ||
| 278 | |||
| 279 | my $nodes = Nano::Nodes->new; | ||
| 280 | |||
| 281 | =back | ||
| 282 | |||
| 283 | =cut | ||
| 284 | |||
| 285 | =head2 search | ||
| 286 | |||
| 287 | Search | ||
| 288 | |||
| 289 | This type is defined in the L<Nano::Types> library. | ||
| 290 | |||
| 291 | =over 4 | ||
| 292 | |||
| 293 | =item search parent | ||
| 294 | |||
| 295 | Object | ||
| 296 | |||
| 297 | =back | ||
| 298 | |||
| 299 | =over 4 | ||
| 300 | |||
| 301 | =item search composition | ||
| 302 | |||
| 303 | InstanceOf["Nano::Search"] | ||
| 304 | |||
| 305 | =back | ||
| 306 | |||
| 307 | =over 4 | ||
| 308 | |||
| 309 | =item search example #1 | ||
| 310 | |||
| 311 | # given: synopsis | ||
| 312 | |||
| 313 | use Nano::Nodes; | ||
| 314 | use Nano::Search; | ||
| 315 | |||
| 316 | my $search = Nano::Search->new(nodes => Nano::Nodes->new); | ||
| 317 | |||
| 318 | =back | ||
| 319 | |||
| 320 | =cut | ||
| 321 | |||
| 322 | =head2 table | ||
| 323 | |||
| 324 | Table | ||
| 325 | |||
| 326 | This type is defined in the L<Nano::Types> library. | ||
| 327 | |||
| 328 | =over 4 | ||
| 329 | |||
| 330 | =item table parent | ||
| 331 | |||
| 332 | Object | ||
| 333 | |||
| 334 | =back | ||
| 335 | |||
| 336 | =over 4 | ||
| 337 | |||
| 338 | =item table composition | ||
| 339 | |||
| 340 | InstanceOf["Zing::Table"] | ||
| 341 | |||
| 342 | =back | ||
| 343 | |||
| 344 | =over 4 | ||
| 345 | |||
| 346 | =item table example #1 | ||
| 347 | |||
| 348 | # given: synopsis | ||
| 349 | |||
| 350 | use Zing::Table; | ||
| 351 | |||
| 352 | my $lookup = Zing::Table->new(name => 'users'); | ||
| 353 | |||
| 354 | =back | ||
| 355 | |||
| 356 | =cut | ||
| 357 | |||
| 358 | =head1 AUTHOR | ||
| 359 | |||
| 360 | Al Newkirk, C<awncorp@cpan.org> | ||
| 361 | |||
| 362 | =head1 LICENSE | ||
| 363 | |||
| 364 | Copyright (C) 2011-2019, Al Newkirk, et al. | ||
| 365 | |||
| 366 | This is free software; you can redistribute it and/or modify it under the terms | ||
| 367 | of the The Apache License, Version 2.0, as elucidated in the L<"license | ||
| 368 | file"|https://github.com/cpanery/nano/blob/master/LICENSE>. | ||
| 369 | |||
| 370 | =head1 PROJECT | ||
| 371 | |||
| 372 | L<Wiki|https://github.com/cpanery/nano/wiki> | ||
| 373 | |||
| 374 | L<Project|https://github.com/cpanery/nano> | ||
| 375 | |||
| 376 | L<Initiatives|https://github.com/cpanery/nano/projects> | ||
| 377 | |||
| 378 | L<Milestones|https://github.com/cpanery/nano/milestones> | ||
| 379 | |||
| 380 | L<Contributing|https://github.com/cpanery/nano/blob/master/CONTRIBUTE.md> | ||
| 381 | |||
| 382 | L<Issues|https://github.com/cpanery/nano/issues> | ||
| 383 | |||
| 384 | =cut |