Lazy attributes should trigger HTTP request
aggrolite opened this issue · comments
Curtis Brandt commented
I can make objects directly from subclasses. For example:
my $link = Mojo::Snoo::Link->new('38pdo9');
However, the only attribute available so far, since no HTTP request has been made, is id
.
say $link->id; # 38pdo9
say $link->author; # Can't locate object method "author" via package "Mojo::Snoo::Link"
Since I'd like to keep everything lazy, there needs to be a way for these attributes to trigger a HTTP request. This also brings up some other topics, such as how often should these lazy attributes be refreshed (if at all)?