File Coverage

blib/lib/STIX/Observable/Extension/Archive.pm
Criterion Covered Total %
statement 32 32 100.0
branch n/a
condition n/a
subroutine 11 11 100.0
pod n/a
total 43 43 100.0


line stmt bran cond sub pod time code
1             package STIX::Observable::Extension::Archive;
2              
3 24     24   530 use 5.010001;
  24         110  
4 24     24   170 use strict;
  24         109  
  24         796  
5 24     24   125 use warnings;
  24         56  
  24         1652  
6 24     24   201 use utf8;
  24         55  
  24         216  
7              
8 24     24   977 use STIX::Common::List;
  24         76  
  24         1016  
9 24     24   141 use Types::Standard qw(Str InstanceOf);
  24         57  
  24         265  
10 24     24   49037 use Types::TypeTiny qw(ArrayLike);
  24         67  
  24         201  
11              
12 24     24   15710 use Moo;
  24         66  
  24         209  
13 24     24   11572 use namespace::autoclean;
  24         62  
  24         306  
14              
15             extends 'STIX::Object';
16              
17 24         2401 use constant PROPERTIES => (qw[
18             contains_refs
19             comment
20 24     24   2678 ]);
  24         60  
21              
22 24     24   167 use constant EXTENSION_TYPE => 'archive-ext';
  24         58  
  24         4331  
23              
24             has contains_refs => (
25             is => 'rw',
26             required => 1,
27             isa => ArrayLike [InstanceOf ['STIX::Observable::Directory', 'STIX::Observable::File', 'STIX::Common::Identifier']],
28             default => sub { STIX::Common::List->new }
29             );
30             has comment => (is => 'rw', isa => Str);
31              
32             1;
33              
34             =encoding utf-8
35              
36             =head1 NAME
37              
38             STIX::Observable::Extension::Archive - STIX Cyber-observable Object (SCO) - Archive File Extension
39              
40             =head1 SYNOPSIS
41              
42             use STIX::Observable::Extension::Archive;
43              
44             my $archive_ext = STIX::Observable::Extension::Archive->new();
45              
46              
47             =head1 DESCRIPTION
48              
49             The Archive File extension specifies a default extension for capturing properties
50             specific to archive files.
51              
52             =head2 METHODS
53              
54             L inherits all methods from L
55             and implements the following new ones.
56              
57             =over
58              
59             =item STIX::Observable::Extension::Archive->new(%properties)
60              
61             Create a new instance of L.
62              
63             =item $archive_ext->contains_refs
64              
65             Specifies the files contained in the archive, as a reference to one or more other
66             File Objects. The objects referenced in this list MUST be of type file-object.
67              
68             =item $archive_ext->comment
69              
70             Specifies a comment included as part of the archive file.
71              
72             =back
73              
74              
75             =head2 HELPERS
76              
77             =over
78              
79             =item $archive_ext->TO_JSON
80              
81             Helper for JSON encoders.
82              
83             =item $archive_ext->to_hash
84              
85             Return the object HASH.
86              
87             =item $archive_ext->to_string
88              
89             Encode the object in JSON.
90              
91             =item $archive_ext->validate
92              
93             Validate the object using JSON Schema (see L).
94              
95             =back
96              
97              
98             =head1 SUPPORT
99              
100             =head2 Bugs / Feature Requests
101              
102             Please report any bugs or feature requests through the issue tracker
103             at L.
104             You will be notified automatically of any progress on your issue.
105              
106             =head2 Source Code
107              
108             This is open source software. The code repository is available for
109             public review and contribution under the terms of the license.
110              
111             L
112              
113             git clone https://github.com/giterlizzi/perl-STIX.git
114              
115              
116             =head1 AUTHOR
117              
118             =over 4
119              
120             =item * Giuseppe Di Terlizzi
121              
122             =back
123              
124              
125             =head1 LICENSE AND COPYRIGHT
126              
127             This software is copyright (c) 2024 by Giuseppe Di Terlizzi.
128              
129             This is free software; you can redistribute it and/or modify it under
130             the same terms as the Perl 5 programming language system itself.
131              
132             =cut