Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added builder to create a (null) transform if not specified
  • Loading branch information
jberger committed Sep 28, 2011
1 parent 79c7f20 commit 9459169
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Physics/UEMColumn.pm
Expand Up @@ -12,12 +12,13 @@ class Physics::UEMColumn {
use Physics::UEMColumn::Pulse;
use Physics::UEMColumn::Laser;
use Physics::UEMColumn::Photocathode;
use Physics::UEMColumn::Transform;

use Physics::UEMColumn::Auxiliary ':all';

has 'debug' => ( isa => 'Num', is => 'ro', default => 0);

has 'transform' => ( isa => 'Physics::UEMColumn::Transform', is = 'ro', predicate => 'has_transform' );
has 'transform' => ( isa => 'Physics::UEMColumn::Transform', is = 'ro', builder => '_make_transform' );

has 'number' => ( isa => 'Num', is => 'rw', required => 1);

Expand Down Expand Up @@ -45,6 +46,10 @@ class Physics::UEMColumn {
has 'solver_opts' => ( isa => 'HashRef', is => 'rw', default => sub { {} } );
has 'need_jacobian' => ( isa => 'Bool', is => 'ro', default => 0 );

method _make_transform () {
return Physics::UEMColumn::Transform->new();
}

method _generate_pulse () {
$self->column->photocathode->generate_pulse( $self->column, $self->number);
}
Expand Down

0 comments on commit 9459169

Please sign in to comment.