view release on metacpan or search on metacpan
lib/Amazon/S3/SignedURLGenerator.pm view on Meta::CPAN
$args{prefix} ||= 'https://s3.amazonaws.com';
$args{expires} ||= 3600;
$args{prefix} =~ s/\/$//; # remove last /
return bless \%args, $class;
}
sub generate_url {
my ($self, $method, $path, $headers) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/S3/Thin/ResponseParser.pm view on Meta::CPAN
sub new {
my ($class, %args) = @_;
my $xml = exists $args{xml} ? $args{xml} : XML::LibXML->new();
return bless {
xml => $xml,
}, $class;
}
sub _xpc {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/S3/Thin.pm view on Meta::CPAN
delete $self->{aws_secret_access_key};
delete $self->{aws_session_token};
}
delete $self->{credential_provider};
bless $self, $class;
$self->secure(0) unless defined $self->secure;
$self->ua($self->_default_ua) unless defined $self->ua;
$self->debug(0) unless defined $self->debug;
$self->virtual_host(0) unless defined $self->virtual_host;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/S3Curl/PurePerl/Digest/HMAC.pm view on Meta::CPAN
{
my($class, $key, $hasher, $block_size) = @_;
$block_size ||= 64;
$key = $hasher->new->add($key)->digest if length($key) > $block_size;
my $self = bless {}, $class;
$self->{k_ipad} = $key ^ (chr(0x36) x $block_size);
$self->{k_opad} = $key ^ (chr(0x5c) x $block_size);
$self->{hasher} = $hasher->new->add($self->{k_ipad});
$self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/SQS/Exception.pm view on Meta::CPAN
$self->{_requestId} = $errorInfo->{RequestId} // q{};
$self->{_xml} = $errorInfo->{XML} // q{};
$self->{_httpError} = $errorInfo->{HTTPError} // q{};
}
return bless $self, $class;
}
#
# Gets error type returned by the service if available.
#
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/SQS/Consumer.pm view on Meta::CPAN
sub new {
my $class = shift;
my %args = @_;
my $me = \%args;
bless $me, $class;
$me->initialize;
return $me;
}
sub initialize {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/SQS/Simple/Base.pm view on Meta::CPAN
if (!$self->{UseIAMRole} && (!$self->{AWSAccessKeyId} || !$self->{SecretKey})) {
croak "Missing AWSAccessKey or SecretKey";
}
$self = bless($self, $class);
return $self;
}
sub _api_version {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/SendToKindle.pm view on Meta::CPAN
smtp_port => $_[4],
smtp_user => $_[5],
smtp_password => $_[6]
};
bless $self, $class;
return $self;
}
# Sends the document.
sub send {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amazon/SimpleDB.pm view on Meta::CPAN
use constant KEEP_ALIVE_CACHESIZE => 10;
sub new {
my $class = shift;
my $args = shift || {};
my $self = bless $args, $class;
croak "No aws_access_key_id" unless $self->{aws_access_key_id};
croak "No aws_secret_access_key" unless $self->{aws_secret_access_key};
unless ($self->{agent}) {
my $agent = LWP::UserAgent->new(keep_alive => KEEP_ALIVE_CACHESIZE);
$agent->timeout(10);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Ambrosia/Logger.pm view on Meta::CPAN
use File::Path;
use IO::File;
use Data::Dumper;
use Time::HiRes qw ( time );
use Scalar::Util "blessed";
use Ambrosia::error::Exceptions;
use base qw/Exporter/;
our @EXPORT = qw/logger/;
lib/Ambrosia/Logger.pm view on Meta::CPAN
_op => ( $params{-op} || '' ),
_dir => $params{-dir},
_time => {},
};
$pkg .= $key;
bless $self, $pkg;
no strict 'refs';
no warnings 'redefine';
push @{"${pkg}::ISA"}, __PACKAGE__;
lib/Ambrosia/Logger.pm view on Meta::CPAN
}
}
sub error
{
__info_ex(shift, 'ERROR: ', map { ref $_ && blessed($_) && $_->isa('Ambrosia::error::Exception::Error') ? "$_" : $_ } @_);
}
sub log
{
my ($self, @msg) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
Amethyst/Brain.pm view on Meta::CPAN
use POE;
sub new {
my $class = shift;
my $self = ($#_ == 0) ? { %{ (shift) } } : { @_ };
return bless $self, $class;
}
sub init {
my ($self) = @_;
# Not overriding this is not fatal.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amibroker/OLE/Interface.pm view on Meta::CPAN
croak("No Database path supplied to Amibroker : $!\n")
unless $self->{dbpath};
croak("Invalid Database path to Amibroker : $!\n")
unless -d $self->{dbpath};
bless $self, $class if defined $self;
return $self;
}
=head2 start_amibroker_engine()
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
$args{path} =~ s!::!/!g;
}
$args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm";
$args{wrote} = 0;
bless( \%args, $class );
}
sub call {
my ($self, $method) = @_;
my $obj = $self->load($method) or return;
view all matches for this distribution
view release on metacpan or search on metacpan
t/009_csrf_defender.t view on Meta::CPAN
sub load_config { +{} }
package MyApp::Web::View;
sub new {
bless {}, shift;
}
sub render {
'<!doctype html>
<html>
<form method="post" action="/do">
view all matches for this distribution
view release on metacpan or search on metacpan
t/04_json_encoder.t view on Meta::CPAN
);
}
return $c->create_response(404, [], []);
}
__PACKAGE__->load_plugins('Web::ChromeLogger' => {
json_encoder => JSON->new->ascii(1)->convert_blessed,
});
}
my $mech = Test::WWW::Mechanize::PSGI->new(app => MyApp::Web->to_app);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amon2/Plugin/Web/CpanelJSON.pm view on Meta::CPAN
use strict;
use warnings;
use Amon2::Util ();
use Cpanel::JSON::XS ();
use Scalar::Util qw(blessed);
use HTTP::SecureHeaders;
our $VERSION = "0.01";
my %DEFAULT_CONFIG = (
lib/Amon2/Plugin/Web/CpanelJSON.pm view on Meta::CPAN
json => {
ascii => !!1, # for security
},
# for convenience
unbless_object => undef,
status_code_field => undef,
# for compatibility options
defence_json_hijacking_for_legacy_browser => !!0,
);
lib/Amon2/Plugin/Web/CpanelJSON.pm view on Meta::CPAN
}
return sub {
my ($data, $spec) = @_;
if (my $unbless_object = $conf->{unbless_object}) {
if (blessed($data)) {
$data = $unbless_object->($data, $spec);
}
}
my $output = $json->encode($data, $spec);
lib/Amon2/Plugin/Web/CpanelJSON.pm view on Meta::CPAN
=item name
Name of method. Default: 'render_json'
=item unbless_object
Default: undef
This option is preprocessing coderef encoding an blessed object in JSON.
For example, the code using L<Object::UnblessWithJSONSpec> is as follows:
use Object::UnblessWithJSONSpec ();
__PACKAGE__->load_plugins(
'Web::CpanelJSON' => {
unbless_object => \&Object::UnblessWithJSONSpec::unbless_with_json_spec,
}
);
...
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
$args{path} =~ s!::!/!g;
}
$args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm";
$args{wrote} = 0;
bless( \%args, $class );
}
sub call {
my ($self, $method) = @_;
my $obj = $self->load($method) or return;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amon2/Plugin/Web/Woothee.pm view on Meta::CPAN
use warnings;
use Woothee;
sub new {
my ($class, %args) = @_;
bless \%args, $class;
}
sub user_agent { $_[0]->{user_agent} }
sub name { $_[0]->_get('name') }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
$args{path} =~ s!::!/!g;
}
$args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm";
$args{wrote} = 0;
bless( \%args, $class );
}
sub call {
my ($self, $method) = @_;
my $obj = $self->load($method) or return;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amon2.pm view on Meta::CPAN
}
sub new {
my $class = shift;
my %args = @_ == 1 ? %{ $_[0] } : @_;
bless { %args }, $class;
}
# For CLI.
sub bootstrap {
my $class = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Amp/Util/Strings.pm view on Meta::CPAN
sub json_encode {
my $self = shift;
my $string = shift;
my $opts = shift;
my $json = JSON->new->allow_nonref->allow_blessed->utf8;
if ($opts->{pretty}) {
$json->pretty(1);
}
if ($opts->{indent}) {
$json->indent(1);
lib/Amp/Util/Strings.pm view on Meta::CPAN
}
sub json_decode {
my $self = shift;
my $string = shift;
my $json = JSON->new->allow_nonref->allow_blessed->utf8;
my $data;
if (defined $string) {
$data = $json->decode($string);
}
return $data;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Analizo/Batch.pm view on Meta::CPAN
use parent qw( Analizo::Filter::Client );
sub new {
my ($class, @options) = @_;
return bless { @options }, $class;
}
sub next {
my ($self) = @_;
my $next_job = $self->fetch_next();
view all matches for this distribution