File Coverage

blib/lib/Erlang/Parser/Node/VariableRecordUpdate.pm
Criterion Covered Total %
statement 7 7 100.0
branch n/a
condition 2 2 100.0
subroutine 2 2 100.0
pod 1 1 100.0
total 12 12 100.0


line stmt bran cond sub pod time code
1             # Copyright 2011-2012 Yuki Izumi. ( anneli AT cpan DOT org )
2             # This is free software; you can redistribute it and/or modify it under the
3             # same terms as Perl itself.
4              
5             package Erlang::Parser::Node::VariableRecordUpdate;
6              
7 3     3   11 use Moose;
  3         4  
  3         15  
8             with 'Erlang::Parser::Node';
9              
10             has 'variable' => (is => 'rw', required => 1, isa => 'Erlang::Parser::Node::Variable');
11             has 'update' => (is => 'rw', required => 1, isa => 'Erlang::Parser::Node::RecordNew');
12              
13             sub print {
14 188     188 1 269 my ($self, $fh, $depth) = @_;
15 188   100     366 $depth ||= 0;
16              
17 188         5259 $self->variable->print($fh, $depth);
18 188         5161 $self->update->print($fh, $depth);
19             }
20              
21             __PACKAGE__->meta->make_immutable;
22              
23             =head1 NAME
24              
25             Erlang::Parser::Node::VariableRecordUpdate - variable record update
26              
27             =head1 DESCRIPTION
28              
29             An update of a variable record's component.
30              
31             =head2 Accessors
32              
33             =over 4
34              
35             =item C<variable>
36              
37             The L<Erlang::Parser::Node::Variable> which is being updated.
38              
39             =item C<record>
40              
41             An L<Erlang::Parser::Node::RecordNew> which updates parts of the record.
42              
43             =back
44              
45             =head2 Methods
46              
47             =over 4
48              
49             =item C<print>
50              
51             Pretty-prints the node to its filehandle argument.
52              
53             =back
54              
55             =head1 EXAMPLE
56              
57             MyVar#state{part=42}
58              
59             =cut
60              
61             1;
62              
63             # vim: set sw=4 ts=4: