| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# Copyright Infomation |
|
2
|
|
|
|
|
|
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
3
|
|
|
|
|
|
|
# Author : Dr. Ahmed Amin Elsheshtawy, Ph.D. |
|
4
|
|
|
|
|
|
|
# Website: https://github.com/mewsoft/Nile, http://www.mewsoft.com |
|
5
|
|
|
|
|
|
|
# Email : mewsoft@cpan.org, support@mewsoft.com |
|
6
|
|
|
|
|
|
|
# Copyrights (c) 2014-2015 Mewsoft Corp. All rights reserved. |
|
7
|
|
|
|
|
|
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
8
|
|
|
|
|
|
|
package Nile::Result; |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.55'; |
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:MEWSOFT'; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=pod |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=encoding utf8 |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 NAME |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Nile::Result - Result class for the Nile framework. |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub main { |
|
24
|
|
|
|
|
|
|
my ($self, $arg) = @_; |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $app = $self->app; |
|
27
|
|
|
|
|
|
|
my $setting = $self->setting(); |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# delegate to HTTP::BrowserDetect new object |
|
30
|
|
|
|
|
|
|
$app->result( HTTP::BrowserDetect->new($app->env->{HTTP_USER_AGENT}) ); |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
$result = $obj->main; |
|
34
|
|
|
|
|
|
|
if ($app->is_result($result)) { |
|
35
|
|
|
|
|
|
|
(@data) = $result->get; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Nile::Result - Result base class for the Nile framework. |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
46
|
|
|
|
|
|
|
sub new { |
|
47
|
0
|
|
|
0
|
0
|
|
my ($class, @arg) = @_; |
|
48
|
0
|
|
|
|
|
|
my $self = bless {}, $class; |
|
49
|
0
|
|
|
|
|
|
$self->{arg} = [@arg]; |
|
50
|
0
|
|
|
|
|
|
return $self; |
|
51
|
|
|
|
|
|
|
} |
|
52
|
|
|
|
|
|
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
53
|
|
|
|
|
|
|
sub get { |
|
54
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
|
55
|
0
|
|
|
|
|
|
my @arg = @{$self->{arg}}; |
|
|
0
|
|
|
|
|
|
|
|
56
|
0
|
0
|
|
|
|
|
return wantarray? @arg : $arg[0]; |
|
57
|
|
|
|
|
|
|
} |
|
58
|
|
|
|
|
|
|
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=pod |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 Bugs |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
This project is available on github at L<https://github.com/mewsoft/Nile>. |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 HOMEPAGE |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Please visit the project's homepage at L<https://metacpan.org/release/Nile>. |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 SOURCE |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Source repository is at L<https://github.com/mewsoft/Nile>. |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
See L<Nile> for details about the complete framework. |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 AUTHOR |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Ahmed Amin Elsheshtawy, اØÙ
د اÙ
ÙÙ Ø§ÙØ´Ø´ØªØ§ÙÙ <mewsoft@cpan.org> |
|
81
|
|
|
|
|
|
|
Website: http://www.mewsoft.com |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Copyright (C) 2014-2015 by Dr. Ahmed Amin Elsheshtawy اØÙ
د اÙ
ÙÙ Ø§ÙØ´Ø´ØªØ§ÙÙ mewsoft@cpan.org, support@mewsoft.com, |
|
86
|
|
|
|
|
|
|
L<https://github.com/mewsoft/Nile>, L<http://www.mewsoft.com> |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=cut |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
1; |