File Coverage

blib/lib/STIX/Observable/URL.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::URL;
2              
3 24     24   523 use 5.010001;
  24         111  
4 24     24   186 use strict;
  24         55  
  24         795  
5 24     24   150 use warnings;
  24         79  
  24         1738  
6 24     24   176 use utf8;
  24         85  
  24         252  
7              
8 24     24   1299 use Types::Standard qw(Str);
  24         54  
  24         240  
9              
10 24     24   81521 use Moo;
  24         67  
  24         219  
11 24     24   10880 use namespace::autoclean;
  24         67  
  24         260  
12              
13             extends 'STIX::Observable';
14              
15 24         2429 use constant SCHEMA =>
16 24     24   2634 'http://raw.githubusercontent.com/oasis-open/cti-stix2-json-schemas/stix2.1/schemas/observables/url.json';
  24         64  
17              
18 24         1683 use constant PROPERTIES =>
19 24     24   157 (qw(type id), qw(spec_version object_marking_refs granular_markings defanged extensions), qw(value));
  24         55  
20              
21 24     24   143 use constant STIX_OBJECT => 'SCO';
  24         51  
  24         1264  
22 24     24   129 use constant STIX_OBJECT_TYPE => 'url';
  24         50  
  24         2744  
23              
24             has value => (is => 'rw', isa => Str, required => 1);
25              
26             1;
27              
28             =encoding utf-8
29              
30             =head1 NAME
31              
32             STIX::Observable::URL - STIX Cyber-observable Object (SCO) - URL
33              
34             =head1 SYNOPSIS
35              
36             use STIX::Observable::URL;
37              
38             my $url = STIX::Observable::URL->new();
39              
40              
41             =head1 DESCRIPTION
42              
43             The URL Object represents the properties of a uniform resource locator
44             (URL).
45              
46              
47             =head2 METHODS
48              
49             L inherits all methods from L
50             and implements the following new ones.
51              
52             =over
53              
54             =item STIX::Observable::URL->new(%properties)
55              
56             Create a new instance of L.
57              
58             =item $url->id
59              
60             =item $url->type
61              
62             The value of this property MUST be C.
63              
64             =item $url->value
65              
66             Specifies the value of the URL.
67              
68             =back
69              
70              
71             =head2 HELPERS
72              
73             =over
74              
75             =item $url->TO_JSON
76              
77             Encode the object in JSON.
78              
79             =item $url->to_hash
80              
81             Return the object HASH.
82              
83             =item $url->to_string
84              
85             Encode the object in JSON.
86              
87             =item $url->validate
88              
89             Validate the object using JSON Schema (see L).
90              
91             =back
92              
93              
94             =head1 SUPPORT
95              
96             =head2 Bugs / Feature Requests
97              
98             Please report any bugs or feature requests through the issue tracker
99             at L.
100             You will be notified automatically of any progress on your issue.
101              
102             =head2 Source Code
103              
104             This is open source software. The code repository is available for
105             public review and contribution under the terms of the license.
106              
107             L
108              
109             git clone https://github.com/giterlizzi/perl-STIX.git
110              
111              
112             =head1 AUTHOR
113              
114             =over 4
115              
116             =item * Giuseppe Di Terlizzi
117              
118             =back
119              
120              
121             =head1 LICENSE AND COPYRIGHT
122              
123             This software is copyright (c) 2024 by Giuseppe Di Terlizzi.
124              
125             This is free software; you can redistribute it and/or modify it under
126             the same terms as the Perl 5 programming language system itself.
127              
128             =cut