view release on metacpan or search on metacpan
lib/Math/SymbolicX/Calculator/Interface/Shell.pm view on Meta::CPAN
input_handle => $args{input_handle} || \*STDIN,
prompt => _dor($args{prompt}, '~> '),
continued_prompt => _dor($args{continued_prompt}, '>> '),
app_name => _dor($args{app_name}, 'Symbolic Calculator Shell'),
};
bless $self => $class;
$self->_setup_readline();
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Math/SymbolicX/Calculator/Interface/Web.pm view on Meta::CPAN
my $self = {
calc => $args{calculator}
|| Math::SymbolicX::Calculator->new(),
};
bless $self => $class;
return $self;
}
=head2 execute_expression
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Math/Taylor.pm view on Meta::CPAN
$self->{point} = $proto->{point} if defined $proto->{point};
$self->{remainder_type} = $proto->{remainder_type}
if defined $proto->{remainder_type};
}
bless $self => $class;
$self->function( $args{function} ) if exists $args{function};
$self->variable( $args{variable} ) if exists $args{variable};
$self->point( $args{point} ) if exists $args{point};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Metabase/Client/Simple.pm view on Meta::CPAN
my $args = $class->__validate_args( \@args, { map { $_ => 1 } @valid_args } );
# uri must have a trailing slash
$args->{uri} .= "/" unless substr( $args->{uri}, -1 ) eq '/';
my $self = bless $args => $class;
unless ( $self->profile->isa('Metabase::User::Profile') ) {
Carp::confess("'profile' argument for $class must be a Metabase::User::Profile");
}
unless ( $self->secret->isa('Metabase::User::Secret') ) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Metabase/Web/Model/Metabase.pm view on Meta::CPAN
sub COMPONENT {
my ($class, $c, $user_config) = @_;
my $config = Catalyst::Utils::merge_hashes($default_config, $user_config);
my $self = bless {} => $class;
my $fact_classes = $config->{fact_classes};
Carp::croak "no fact_classes supplied to $class configuration"
unless $fact_classes and @$fact_classes;
view all matches for this distribution
view release on metacpan or search on metacpan
t/delegate.t view on Meta::CPAN
package Second;
sub new {
my $class = shift;
return bless {} => $class;
}
sub name { return __PACKAGE__ }
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mixin/ExtraFields/Driver/DBIC.pm view on Meta::CPAN
id_column => $arg->{id_column} || 'object_id',
name_column => $arg->{name_column} || 'extra_name',
value_column => $arg->{value_column} || 'extra_value',
};
bless $self => $class;
}
sub id_column { $_[0]->{id_column} }
sub name_column { $_[0]->{name_column} }
sub value_column { $_[0]->{value_column} }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mixin/ExtraFields/Driver/HashGuts.pm view on Meta::CPAN
}
sub from_args {
my ($class, $arg) = @_;
my $self = bless { storage => {} } => $class;
$self->{hash_key} = $arg->{hash_key} || $self->default_hash_key;
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
}
};
sub new {
my ($class, $id) = @_;
return bless { id => $id } => $class;
}
sub id { $_[0]{id} }
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/bundled/Software/License.pm view on Meta::CPAN
my ($class, $arg) = @_;
# XXX changed from Carp::croak to die
die "no copyright holder specified" unless $arg->{holder};
bless $arg => $class;
}
sub year { defined $_[0]->{year} ? $_[0]->{year} : (localtime)[5]+1900 }
sub holder { $_[0]->{holder} }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/Generic.pm view on Meta::CPAN
sub new_glob
{
my $that = shift( @_ );
my $class = ref( $that ) || $that;
no warnings 'once';
my $self = bless( \do{ local *FH } => $class );
*$self = {};
if( defined( ${ "${class}\::LOG_DEBUG" } ) )
{
*$self->{log_debug} = ${ "${class}::LOG_DEBUG" };
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/Starter/Plugin/CGIApp.pm view on Meta::CPAN
my $class = ref $proto || $proto;
my $self = $class->SUPER::new(%opts);
$self->{templates} = { $self->templates };
return bless $self => $class;
}
=head2 create_distro ( %args )
This method works as advertised in L<Module::Starter|Module::Starter>.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/Starter/Plugin/Template.pm view on Meta::CPAN
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
$self->{templates} = { $self->templates };
$self->{renderer} = $self->renderer;
return bless $self => $class;
}
=head1 OBJECT METHODS
=head2 C<< templates() >>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojar/Cron/Date.pm view on Meta::CPAN
sub new {
my $proto = shift;
my $class = ref $proto || $proto;
my $payload = @_ ? shift : ref $proto ? $$proto : $class->today;
bless \$payload => $class;
}
sub today {
my ($d, $m , $y) = (localtime)[3, 4, 5];
return shift->new(sprintf '%04u-%02u-%02u', $y + 1900, $m + 1, $d);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojo/Run.pm view on Meta::CPAN
sub _constructor {
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = $class->SUPER::new;
bless $self => $class;
# install SIGCHLD handler
$SIG{'CHLD'} = sub { _sig_chld($self, @_) };
return $self;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojo/Webqq/Run.pm view on Meta::CPAN
sub _constructor {
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = $class->SUPER::new(@_);
bless $self => $class;
# install SIGCHLD handler
$SIG{'CHLD'} = sub { _sig_chld($self, @_) };
return $self;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojo/Weixin/Run.pm view on Meta::CPAN
sub _constructor {
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = $class->SUPER::new(@_);
bless $self => $class;
# install SIGCHLD handler
$SIG{'CHLD'} = sub { _sig_chld($self, @_) };
return $self;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/StaticShare.pm view on Meta::CPAN
#~ if $pkg->can('import');
return $pkg->new()
if $pkg->can('new') && $pkg->can('parse');
return
unless $pkg->can('markdown');
bless {pkg=>$pkg} => $class;
}
sub parse { my $self = shift; no strict 'refs'; ($self->{pkg}.'::markdown')->(@_); }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/Vparam/Address.pm view on Meta::CPAN
use Encode qw(encode is_utf8);
sub new {
my ($class, $opts) = @_;
return bless $opts => $class;
}
=head2 parse $str
Parse address from string
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Mongoose/Engine.pm view on Meta::CPAN
}
}
else { #non-moose
my $data = delete $doc->{$name};
if ( my $data_class = ref $data ) {
$doc->{$name} = $data_class eq 'boolean' ? $data : bless $data => $class;
}
else {
push @later, { attrib => $name, value => $data };
}
}
}
return undef unless defined $doc;
bless $doc => $class_main;
for ( @later ) {
my $attr = $class_main->meta->get_attribute($_->{attrib});
if( defined $attr ) {
# works for read-only values
$attr->set_value($doc, $_->{value});
view all matches for this distribution
view release on metacpan or search on metacpan
lib/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
lib/MooX/Cmd/Tester.pm view on Meta::CPAN
MooX::Cmd::Tester::Result;
sub new
{
my ($class, $arg) = @_;
bless $arg => $class;
}
}
my $res = Package::Stash->new("MooX::Cmd::Tester::Result");
for my $attr (qw(app cmd stdout stderr output error execute_rv exit_code))
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Class/MOP/Instance.pm view on Meta::CPAN
$self->inline_set_slot_value($instance, $slot_name, $self->inline_slot_access($instance, $slot_name));
}
sub inline_rebless_instance_structure {
my ($self, $instance, $class_variable) = @_;
"bless $instance => $class_variable";
}
sub _inline_get_mop_slot {
my ($self, $instance) = @_;
$self->inline_get_slot_value($instance, $RESERVED_MOP_SLOT);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MooseX/ArrayRef/Meta/Instance.pm view on Meta::CPAN
}
override create_instance => sub {
my $meta = shift;
my $class = $meta->associated_metaclass;
bless [ (EMPTY) x $meta->slot_count ] => $class->name;
};
override clone_instance => sub {
my ($meta, $instance) = @_;
my $class = $meta->associated_metaclass;
bless [ @{$instance} ] => $class->name;
};
override get_slot_value => sub {
my ($meta, $instance, $slot_name) = @_;
my $value = $instance->[ $meta->slot_index($slot_name) ];
view all matches for this distribution
view release on metacpan or search on metacpan
lib/MooseX/ClosedHash/Meta/Instance.pm view on Meta::CPAN
}
override create_instance => sub {
my $meta = shift;
my $class = $meta->associated_metaclass;
bless($meta->get_fresh_closure => $class->name);
};
override clone_instance => sub {
my ($meta, $instance) = @_;
my $class = $meta->associated_metaclass;
bless $meta->get_fresh_closure($instance->(clone => ())) => $class->name;
};
override get_slot_value => sub {
my ($meta, $instance, $slot_name) = @_;
$instance->(fetch => $slot_name);
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Class/MOP/Instance.pm view on Meta::CPAN
$self->inline_set_slot_value($instance, $slot_name, $self->inline_slot_access($instance, $slot_name));
}
sub inline_rebless_instance_structure {
my ($self, $instance, $class_variable) = @_;
"bless $instance => $class_variable";
}
sub _inline_get_mop_slot {
my ($self, $instance) = @_;
$self->inline_get_slot_value($instance, $RESERVED_MOP_SLOT);
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/InsideOut/BaseArray.pm view on Meta::CPAN
use constant FOO => 0;
sub new {
my $class = shift;
my %p = @_;
my $self = bless [] => $class;
$self->[FOO] = $p{base_foo};
return $self;
}
sub base_foo {
view all matches for this distribution
view release on metacpan or search on metacpan
package Foo;
sub new {
my $class = shift;
bless { _class => $class }, $class;
}
package Foo::Moose;
use Moose;
use MooseX::NonMoose;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Morpheus/Key.pm view on Meta::CPAN
$key =~ s{/+}{/}g;
$key =~ s{^/*}{/}; #TODO: support relative keys?
$key =~ s{/+$}{};
bless \$key => $class;
}
sub upgrade {
map { ref $_ ? $_ : __PACKAGE__->new($_) } @_;
}
view all matches for this distribution