The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Lego::Part - Lego part object.

SYNOPSIS

 use Lego::Part;

 my $obj = Lego::Part->new;
 my $color = $obj->color($color);
 my $design_id = $obj->design_id($design_id);
 my $element_id = $obj->element_id($element_id);

METHODS

  • new()

     Constructor.
     Returns object.
  • color([$color])

     Get or set color.
     Returns string with color.
  • design_id([$design_id])

     Get or set lego design id.
     Returns string with design ID.
  • element_id([$element_id])

     Get or set lego element id.
     Returns string with element ID.

EXAMPLE1

 use strict;
 use warnings;

 use Lego::Part;

 # Object.
 my $part = Lego::Part->new(
         'color' => 'red',
         'design_id' => '3002',
 );

 # Print color and design ID.
 print 'Color: '.$part->color."\n";
 print 'Design ID: '.$part->design_id."\n";

 # Output:
 # Color: red
 # Design ID: 3002

EXAMPLE2

 use strict;
 use warnings;

 use Lego::Part;

 # Object.
 my $part = Lego::Part->new(
         'element_id' => '300221',
 );

 # Print color and design ID.
 print 'Element ID: '.$part->element_id."\n";

 # Output:
 # Element ID: 300221

DEPENDENCIES

Class::Utils, Error::Pure.

SEE ALSO

Task::Lego

Install the Lego modules.

REPOSITORY

https://github.com/michal-josef-spacek/Lego-Part

AUTHOR

Michal Josef Špaček mailto:skim@cpan.org

http://skim.cz

LICENSE AND COPYRIGHT

© 2013-2023 Michal Josef Špaček

BSD 2-Clause License

VERSION

0.04