# ABSTRACT: A class representing a states response from the OpenSky Network API

package WebService::OpenSky::Response::States;

our $VERSION = '0.009';
use Moose;
use WebService::OpenSky::Core::StateVector;
use experimental qw(signatures);
extends 'WebService::OpenSky::Response';

sub _create_response_objects ($self) {
    return [ map { WebService::OpenSky::Core::StateVector->new($_) } $self->raw_response->{states}->@* ];
}

sub _empty_response ($self) {
    return {
        time   => 0,
        states => [],
    };
}
__PACKAGE__->meta->make_immutable;

__END__

=pod

=encoding UTF-8

=head1 NAME

WebService::OpenSky::Response::States - A class representing a states response from the OpenSky Network API

=head1 VERSION

version 0.009

=head1 DESCRIPTION

This class inherits from L<WebService::OpenSky::Response>. Please see that
module for the available methods. Individual responses are from the
L<WebService::OpenSky::Core::StateVector> class.

=head1 AUTHOR

Curtis "Ovid" Poe <curtis.poe@gmail.com>

=head1 COPYRIGHT AND LICENSE

This software is Copyright (c) 2023 by Curtis "Ovid" Poe.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)

=cut
