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

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

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

with 'DX::Lib::FS::Role::RunOn';

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

1;
