Goo::ProfileOption - Store individual options in the profile


Goo documentation Contained in the Goo distribution.

Index


Code Index:

NAME

Top

Goo::ProfileOption - Store individual options in the profile

SYNOPSIS

Top

use Goo::ProfileOption;

DESCRIPTION

Top

METHODS

Top

new

constructor

get_text

return the text of the option

do

carry out the action!

AUTHOR

Top

Nigel Hamilton <nigel@trexy.com>

SEE ALSO

Top


Goo documentation Contained in the Goo distribution.

#!/usr/bin/perl

package Goo::ProfileOption;

###############################################################################
# Nigel Hamilton
#
# Copyright Nigel Hamilton 2005
# All Rights Reserved
#
# Author:       Nigel Hamilton
# Filename:     Goo::ProfileOption.pm
# Description:  Store individual options in the profile
#
# Date          Change
# ----------------------------------------------------------------------------
# 11/08/2005    Added method: test
#
##############################################################################

use strict;

use Goo::Object;
use Goo::Prompter;

use base qw(Goo::Object);


##############################################################################
#
# new - instantiate an profile_option
#
##############################################################################

sub new {

    my ($class, $params) = @_;

    my $this = $class->SUPER::new();

    $this->{text} = $params->{text};

    return $this;

}


##############################################################################
#
# get_text - return the text of the option
#
##############################################################################

sub get_text {

    my ($this) = @_;

    return $this->{text} || "Text not set for Option";

}


##############################################################################
#
# do - carry out the action!
#
##############################################################################

sub do {

    my ($this) = @_;

    unless ($this->{action}) {

        # no action
        Goo::Prompter::say("No action specified for this option.");
    }

}


1;



__END__