Got inlining for hashes working.
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / Hash / Writer.pm
diff --git a/lib/Moose/Meta/Method/Accessor/Native/Hash/Writer.pm b/lib/Moose/Meta/Method/Accessor/Native/Hash/Writer.pm
new file mode 100644 (file)
index 0000000..ba9b312
--- /dev/null
@@ -0,0 +1,29 @@
+package Moose::Meta::Method::Accessor::Native::Hash::Writer;
+
+use strict;
+use warnings;
+
+use Class::MOP::MiniTrait;
+
+our $VERSION = '1.13';
+$VERSION = eval $VERSION;
+our $AUTHORITY = 'cpan:STEVAN';
+
+use base 'Moose::Meta::Method::Accessor::Native::Writer';
+
+Class::MOP::MiniTrait::apply( __PACKAGE__,
+    'Moose::Meta::Method::Accessor::Native::Hash'
+);
+Class::MOP::MiniTrait::apply( __PACKAGE__,
+    'Moose::Meta::Method::Accessor::Native::Collection'
+);
+
+sub _new_values {'@values'}
+
+sub _inline_copy_old_value {
+    my ( $self, $slot_access ) = @_;
+
+    return '{ @{' . $slot_access . '} }';
+}
+
+1;