| 1 | package Image::Randim::Image; | ||
| 2 | our $VERSION = '0.01'; | ||
| 3 | use v5.20; | ||
| 4 | use warnings; | ||
| 5 | use Moose; | ||
| 6 | use namespace::autoclean; | ||
| 7 | |||
| 8 | has 'id' => ( is => 'rw', | ||
| 9 | isa => 'Str', | ||
| 10 | ); | ||
| 11 | has 'width' => ( is => 'rw', | ||
| 12 | isa => 'Int', | ||
| 13 | ); | ||
| 14 | has 'height' => ( is => 'rw', | ||
| 15 | isa => 'Int', | ||
| 16 | ); | ||
| 17 | has 'url' => ( is => 'rw', | ||
| 18 | isa => 'Str', | ||
| 19 | ); | ||
| 20 | has 'filename' => ( is => 'rw', | ||
| 21 | isa => 'Str', | ||
| 22 | ); | ||
| 23 | has 'owner' => ( is => 'rw', | ||
| 24 | isa => 'Maybe[Str]', | ||
| 25 | ); | ||
| 26 | has 'owner_name' => ( is => 'rw', | ||
| 27 | isa => 'Maybe[Str]', | ||
| 28 | ); | ||
| 29 | has 'link' => ( is => 'rw', | ||
| 30 | isa => 'Str', | ||
| 31 | ); | ||
| 32 | |||
| 33 | __PACKAGE__->meta->make_immutable; | ||
| 34 | 1; | ||
| 35 | |||
| 36 | =pod | ||
| 37 | |||
| 38 | =head1 NAME | ||
| 39 | |||
| 40 | Image::Randim::Image - Image object | ||
| 41 | |||
| 42 | =head1 SYNOPSIS | ||
| 43 | |||
| 44 | use Image::Randim::Source; | ||
| 45 | |||
| 46 | $source = Image::Randim::Source->new; | ||
| 47 | $source->set_provider('Unsplash'); | ||
| 48 | $image = $source->get_image; | ||
| 49 | |||
| 50 | say $image->url; | ||
| 51 | |||
| 52 | =head1 DESCRIPTION | ||
| 53 | |||
| 54 | This is the image object returned by Image::Randim::Source which | ||
| 55 | contains information about the image. | ||
| 56 | |||
| 57 | =head1 ATTRIBUTES | ||
| 58 | |||
| 59 | =head2 C<url> | ||
| 60 | |||
| 61 | The URL where the image can be reached. | ||
| 62 | |||
| 63 | =head2 C<link> | ||
| 64 | |||
| 65 | The URL that links to the page at the source that gives credit to the | ||
| 66 | creator and where you can find more detailed information about the | ||
| 67 | image. | ||
| 68 | |||
| 69 | =head2 C<owner> | ||
| 70 | |||
| 71 | The userid of the owner (author, creator) of the image. Not always | ||
| 72 | there. | ||
| 73 | |||
| 74 | =head2 C<owner_name> | ||
| 75 | |||
| 76 | The full name of the owner, which is not always there. | ||
| 77 | |||
| 78 | =head2 C<width> | ||
| 79 | |||
| 80 | The width in pixels, AS REPORTED BY THE SOURCE SITE. | ||
| 81 | |||
| 82 | =head2 C<height> | ||
| 83 | |||
| 84 | The height in pixels, AS REPORTED BY THE SOURCE SITE. | ||
| 85 | |||
| 86 | =head2 C<filename> | ||
| 87 | |||
| 88 | The local filename, either provided by the source site or created | ||
| 89 | locally. This is not set usually on the source call, but rather on the | ||
| 90 | download call -- don't count on this to be set unless you or a script | ||
| 91 | set it. | ||
| 92 | |||
| 93 | =head1 AUTHOR | ||
| 94 | |||
| 95 | Mark Rushing <mark@orbislumen.net> | ||
| 96 | |||
| 97 | =head1 COPYRIGHT AND LICENSE | ||
| 98 | |||
| 99 | This software is copyright (c) 2017 by Home Grown Systems, SPC. | ||
| 100 | |||
| 101 | This is free software; you can redistribute it and/or modify it under | ||
| 102 | the same terms as the Perl 5 programming language system itself. | ||
| 103 | |||
| 104 | =cut |