Acme-Hospital-Bed

 view release on metacpan or  search on metacpan

lib/Acme/Hospital/Bed.pm  view on Meta::CPAN

package Acme::Hospital::Bed;

use 5.006;
use strict;
use warnings;
our $VERSION = '0.07';

sub new {
	my ($package, %args) = @_;
	$args{total_num_of_rooms} ||= 20;
	$args{lifes} ||= 3;
	$args{rooms} ||= [];
	$args{max_length_of_stay} ||= $args{total_num_of_rooms}*2;
	my $self = bless \%args, $package;
	unless ($self->{names}) {
		$self->{names} = [
			qw/rob robert ben tom dean dennis ruby roxy jane michelle larry liane leanne anne axel/
		];
	}
	unless ($self->{phrases}) {
		$self->{phrases} = [
			[
				"Hello, I am fine.",
				"I still have my mind.",
			],
			[
				"Hello, I am still fine.",
				"I still have my mind."
			],
			[
				"Hello, I am also fine.",
				"I still have my mind."
			],
			[
				"Hello, I think I'm still fine.",
				"I still have my mind."
			],
			[
				"Hello, I think you think I'm fine.",
				"I still have my mind."
			],
			[
				"Hello, am I still fine.",
				"Where is my mind?",
			],
			[
				"Hello, do you still think I'm fine.",
				"Where is my mind?",
			],
			[
				"Hello, I don't feel so fine.",
				"Where is my mind?",
			],
			[
				"Hello, This is not fine.",
				"Where is my mind?",
			],
			[
				"Hello, I'm not fine.",
				"Waiting every 5 minutes...?",
			]
		];
	}
	return $self;
}

sub start { 
	my $self = shift;
	unless (ref $self) {
		$self = __PACKAGE__->new;
	}
	$self->next_patient; 
}



( run in 2.176 seconds using v1.01-cache-2.11-cpan-b16cb0d3907 )