> On 27 May 2015, at 8:47 am, Andrew <[email protected]> wrote:
> 
> So I'm left scratching my head - what does is_file actually do, if it
> doesn't check if a file exists?
> 

A Mojo::Asset::File is always a file, as the name implies, thus it always 
returns true.

If you have a Mojo::Asset, you can use is_file to find out if it is a file (as 
opposed to it being perhaps a Mojo::Asset::Memory object).

if (! $asset->is_file) {
  $asset->move_to(‘/some/other/file.txt’);
}

        - Justin

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to