package DX::Lib::FS::Observation::PathStatus;

use aliased 'DX::Lib::FS::Fact::PathStatus';
use aliased 'DX::Lib::FS::Fact::PathStatusInfo';
use DX::Lib::FS::Guts;
use Moo;

has path => (is => 'ro', required => 1);

sub run {
  my ($self) = @_;
  my $info = DX::Lib::FS::Guts->path_status_info($self->path);
  (path_status => PathStatus->new(
    path => $self->path,
    ($info
      ? (info => PathStatusInfo->new($info))
      : ()
    )
  ));
}

1;
