view release on metacpan or search on metacpan
lib/RDF/TrineX/Serializer/MockTurtleSoup.pm view on Meta::CPAN
use parent 'RDF::Trine::Serializer';
sub new
{
my $class = shift;
my $self = bless { @_==1 ? %{$_[0]} : @_ } => $class;
$self->{prefixes} ||= delete $self->{namespaces};
$self->{labelling} //= $rdfs->label->uri;
$self->{priorities} ||= undef;
$self->{abbreviate} //= undef;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/REST/Consumer/HandlerInvocation.pm view on Meta::CPAN
# hash. It represents an invocation of a particular response-code handler.
#
# Your code should never need to instantiate this class itself.
sub new {
my ($class, %args) = @_;
my $self = (bless {%args} => $class);
$self->{debugger} ||= sub {};
return $self;
}
# Here are elments of the public API:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/RPM/Payload.pm view on Meta::CPAN
open my $fh, "-|", "rpm2cpio", $f
or die "$f: rpm2cpio failed";
# n1: current data pos
# n2: end data pos
# n3: next entry pos
bless [ $f, $fh, 0, 0, 0 ] => $class;
}
sub _skip ($$$) {
my ($f, $fh, $n) = @_;
while ($n > 0) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/RePrec.pm view on Meta::CPAN
$self->{rels} = $rels;
$self->{nrels} = $nrels;
$self->{numdocs} = $rels + $nrels;
bless $self => $class;
$self->_sortrfdata($distribution);
$self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Regexp/Melody.pm view on Meta::CPAN
sub new {
my ( $class, $input ) = @_;
my $output = compiler( $input );
my $regexp = qr/$output/;
my $self = bless( $regexp => $class );
$melody{$self} = $input;
return $self;
}
sub to_melody {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Regexp/N_Queens.pm view on Meta::CPAN
#
# OUT: Blessed object, uninitialized object
#
################################################################################
sub new ($class) {bless \do {my $v => $class}}
################################################################################
#
# sub init ($self, @args)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Regexp/Sudoku.pm view on Meta::CPAN
#
# Create an uninitialized object.
#
################################################################################
sub new ($class) {bless \do {my $v} => $class}
################################################################################
#
# init_sizes ($self, $size)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Religion/Bible/Reference.pm view on Meta::CPAN
my $self;
return unless $self->{book} = $class->canonicalize_book($bibref{book});
bless $self => $class;
return unless my $range = $self->_parse_ranges($bibref{ranges});
$self->{chapter} = $range->{chapter};
$self->{ranges} = $range->{ranges};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Return/Value.pm view on Meta::CPAN
my ($self, $key, $value) = @_;
my $class = ref $self;
bless $self => "ain't::overloaded";
$self->{$key} = $value if @_ > 2;
my $return = $self->{$key};
bless $self => $class;
return $return;
}
sub _builder {
my %args = (type => shift);
lib/Return/Value.pm view on Meta::CPAN
#pod
#pod =cut
sub new {
my $class = shift;
bless { type => 'failure', string => q{}, prop => {}, @_ } => $class;
}
#pod =pod
#pod
#pod =item bool
view all matches for this distribution
view release on metacpan or search on metacpan
local/lib/perl5/Moo/Object.pm view on Meta::CPAN
# duplicated in Moo::Role
sub meta {
require Moo::HandleMoose::FakeMetaClass;
my $class = ref($_[0])||$_[0];
bless({ name => $class }, 'Moo::HandleMoose::FakeMetaClass');
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
examples/currency.pl view on Meta::CPAN
# would have better validation
sub new {
my ( $class, $arg_for ) = @_;
$arg_for ||= {};
my $amount = $arg_for->{amount} || 0;
bless { amount => $amount } => $class;
}
sub amount {
my $self = shift;
return $self->{amount} unless @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Rubric/WebApp/Session.pm view on Meta::CPAN
#pod
#pod =cut
sub new {
my ($class, $data) = @_;
bless $data => $class;
}
#pod =head2 param
#pod
#pod $obj->param('foo'); # get
view all matches for this distribution
view release on metacpan or search on metacpan
t/extendingrect.t view on Meta::CPAN
my $self = $class->SUPER::new(@_);
unless ( ref $self ) {
require Carp;
Carp::confess SDL::GetError();
}
return bless $self => $class;
}
sub foo {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
examples/My/PersistentIterator.pm view on Meta::CPAN
my $iterator;
sub new {
my $self = shift;
my $class = ref($self) || $self;
$iterator ||= (bless {_num=>shift} => $class);
}
sub next {
my $self = shift;
$self->{_num}++;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/SOAP/Transport/FTP.pm view on Meta::CPAN
while (@_) {
$class->can($_[0])
? push(@method_from, shift() => shift)
: push(@arg_from, shift)
}
my $self = bless {@arg_from} => $class;
while (@method_from) {
my($method, $param_ref) = splice(@method_from,0,2);
$self->$method(ref $param_ref eq 'ARRAY' ? @$param_ref : $param_ref)
}
return $self;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/SOAP/Transport/MQ.pm view on Meta::CPAN
while (@_) {
$class->can( $_[0] )
? push( @methods, shift() => shift )
: push( @params, shift );
}
my $self = bless {@params} => $class;
while (@methods) {
my ( $method, $params ) = splice( @methods, 0, 2 );
$self->$method( ref $params eq 'ARRAY' ? @$params : $params );
}
SOAP::Trace::objects('()');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/SQL/Type/Guess.pm view on Meta::CPAN
"decimal;varchar" => 'varchar(%1$d)',
"decimal;decimal" => 'decimal(%2$d,%3$d)',
";" => '',
};
bless \%options => $class;
}
=head2 C<< $g->column_type >>
$g->guess({ foo => 1, bar => 'Hello' },{ foo => 1000, bar => 'World' });
view all matches for this distribution
view release on metacpan or search on metacpan
FH: {
package My::FH;
sub TIEHANDLE {
my ($class, $buf) = @_;
bless { buf => $buf } => $class;
}
sub PRINT {
${ shift->{buf} } .= join '', @_;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Tie/Hash/SerializedString.pm view on Meta::CPAN
my $class = shift;
my ($ref, $implementation) = @_;
croak "need a scalar ref to tie hash to" unless ref $ref eq 'SCALAR';
$implementation = "Scalar::Accessors::LikeHash::JSON" unless defined $implementation;
Module::Runtime::use_package_optimistically($implementation);
bless [$implementation, $ref] => $class;
}
for my $method (qw( STORE FETCH EXISTS DELETE CLEAR ))
{
my $lc_method = lc $method;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/SystemCatalog.pm view on Meta::CPAN
=cut
sub new {
my $class = shift;
my $dbi = shift;
my $obj = bless { dbi => $dbi, class => $class, schema => '' },$class;
$obj->{Driver} = $obj->{dbi}->{Driver}->{Name};
# Only base class can dispatch to more specific class
if ($class eq 'DBIx::SystemCatalog') {
my $driver_name = 'DBIx::SystemCatalog::'.$obj->{Driver};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Scope/Session/Flyweight.pm view on Meta::CPAN
my ( $class, %args ) = @_;
return $args{id};
}
sub new {
my ( $class, %args ) = @_;
return bless {%args} => $class;
}
my $flyweight = Test::Object->acquire( id => 10 );
my $flyweight2 = Test::Object->acquire( id => 10 );
=head1 METHODS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Scrabble/Dict.pm view on Meta::CPAN
_undefined_as => delete $init{undefined_as} || $defaults{undefined_as},
};
$self->{_ua} = LWP::UserAgent->new(%init, cookie_jar => {});
return bless $self => $class;
}
sub define {
my ($self, $word) = (shift, lc shift);
my $ua = $self->{_ua};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Search/Fulltext/Tokenizer/Ngram.pm view on Meta::CPAN
unless (looks_like_number $token_length and $token_length > 0) {
Carp::croak('Token length must be 1+.');
}
bless +{ token_length => $token_length } => $class;
}
sub create_token_iterator {
my ($self, $text) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Search/GIN/Extract/Class.pm view on Meta::CPAN
my $meta = Class::MOP::get_metaclass_by_name($class);
my @roles = $meta && $meta->can("calculate_all_roles") ? ( map { $_->name } $meta->calculate_all_roles ) : ();
return $self->process_keys({
blessed => $class,
class => $isa,
does => \@roles,
});
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/SemVer/V2/Strict.pm view on Meta::CPAN
sub pre_release { shift->{pre_release} }
sub build_metadata { shift->{build_metadata} }
sub new {
my $class = shift;
my $self = bless {} => $class;
$self->_init_by_version_numbers if @_ == 0;
$self->_init_by_version_string(@_) if @_ == 1;
$self->_init_by_version_numbers(@_) if @_ >= 2;
view all matches for this distribution
view release on metacpan or search on metacpan
author_tools/freeze_thaw_timing.pl view on Meta::CPAN
package Foo;
sub new {
my $class= shift;
return bless( {@_} => $class );
}
sub FREEZE {
my ( $self, $serializer )= @_;
return $self->{name}; # performance
view all matches for this distribution
view release on metacpan or search on metacpan
author_tools/freeze_thaw_timing.pl view on Meta::CPAN
package Foo;
sub new {
my $class= shift;
return bless( {@_} => $class );
}
sub FREEZE {
my ( $self, $serializer )= @_;
return $self->{name}; # performance
view all matches for this distribution
view release on metacpan or search on metacpan
author_tools/freeze_thaw_timing.pl view on Meta::CPAN
my $dec = Sereal::Decoder->new();
package Foo;
sub new {
my $class = shift;
return bless({@_} => $class);
}
sub FREEZE {
my ($self, $serializer) = @_;
return $self->{name}; # performance
view all matches for this distribution
view release on metacpan or search on metacpan
Iterator/author_tools/freeze_thaw_timing.pl view on Meta::CPAN
my $dec = Sereal::Decoder->new();
package Foo;
sub new {
my $class = shift;
return bless({@_} => $class);
}
sub FREEZE {
my ($self, $serializer) = @_;
return $self->{name}; # performance
view all matches for this distribution
view release on metacpan or search on metacpan
t/130_freezethaw.t view on Meta::CPAN
package Foo;
sub new {
my $class= shift;
return bless( { bar => 1, @_ } => $class );
}
sub FREEZE {
my ( $self, $serializer )= @_;
$freeze_called= $serializer eq 'Sereal' ? 1 : 0;
t/130_freezethaw.t view on Meta::CPAN
package Bar;
sub new {
my $class= shift;
return bless( { bar => 1, @_ } => $class );
}
sub FREEZE {
my ( $self, $serializer )= @_;
return "frozen Bar";
view all matches for this distribution