| Sleep documentation | Contained in the Sleep distribution. |
Sleep::Request - A Sleep request.
Constructor. Needs three arguments: request, the apache request; db, a
database object; and vars, an array with the variables parsed from the URL.
Returns the first variable from vars.
Parses the JSON data in $data to a perl representation. Retrieve this value using data.
Return the parsed data object.
If you find a bug, please let the author know.
Copyright (c) 2008 Peter Stuifzand. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Peter Stuifzand <peter@stuifzand.eu>
| Sleep documentation | Contained in the Sleep distribution. |
package Sleep::Request; use strict; use warnings; use JSON::XS; sub new { my $klass = shift; my $request = shift; my $db = shift; my @vars = @_; my $self = bless { request => $request, db => $db, vars => \@vars }, $klass; return $self; } sub id { my $self = shift; return $self->{vars}->[0]; } sub decode { my $self = shift; my $data = shift; $self->{data} = decode_json($data); return; } sub data { my $self = shift; return $self->{data}; } 1; __END__