]> Dogcows Code - chaz/p5-File-KDBX/blobdiff - lib/File/KDBX/IO/Crypt.pm
Add function for creating class attributes
[chaz/p5-File-KDBX] / lib / File / KDBX / IO / Crypt.pm
index 22fe45e306064990cd0724be36e841265a4a7db8..4218af21fb0aeba685e3ba3dbbed478e55285413 100644 (file)
@@ -6,33 +6,15 @@ use strict;
 
 use Errno;
 use File::KDBX::Error;
-use File::KDBX::Util qw(:empty);
+use File::KDBX::Util qw(:class :empty);
 use namespace::clean;
 
-use parent 'File::KDBX::IO';
+extends 'File::KDBX::IO';
 
 our $VERSION = '999.999'; # VERSION
 our $BUFFER_SIZE = 16384;
 our $ERROR;
 
-=method new
-
-    $fh = File::KDBX::IO::Crypt->new(%attributes);
-    $fh = File::KDBX::IO::Crypt->new($fh, %attributes);
-
-Construct a new crypto IO handle.
-
-=cut
-
-sub new {
-    my $class = shift;
-    my %args = @_ % 2 == 1 ? (fh => shift, @_) : @_;
-    my $self = $class->SUPER::new;
-    $self->_fh($args{fh}) or throw 'IO handle required';
-    $self->cipher($args{cipher}) or throw 'Cipher required';
-    return $self;
-}
-
 =attr cipher
 
 A L<File::KDBX::Cipher> instance to do the actual encryption or decryption.
@@ -51,6 +33,24 @@ while (my ($attr, $default) = each %ATTRS) {
     };
 }
 
+=method new
+
+    $fh = File::KDBX::IO::Crypt->new(%attributes);
+    $fh = File::KDBX::IO::Crypt->new($fh, %attributes);
+
+Construct a new crypto IO handle.
+
+=cut
+
+sub new {
+    my $class = shift;
+    my %args = @_ % 2 == 1 ? (fh => shift, @_) : @_;
+    my $self = $class->SUPER::new;
+    $self->_fh($args{fh}) or throw 'IO handle required';
+    $self->cipher($args{cipher}) or throw 'Cipher required';
+    return $self;
+}
+
 sub _FILL {
     my ($self, $fh) = @_;
 
This page took 0.017634 seconds and 4 git commands to generate.