view release on metacpan or search on metacpan
lib/HAL/Resource.pm view on Meta::CPAN
my $class = $options{ class } || ref $self;
my $ua = $self->ua;
my $url = $self->resource_url( $name )
or croak "Couldn't find resource '$name' in " . join ",", sort keys %{$self->_links};
Future->done( $ua->get( $url ))->then( sub( $res ) {
Future->done( bless { ua => $ua, %{ decode_json( $res->content )} } => $class );
});
}
sub fetch_resource( $self, $name, %options ) {
$self->fetch_resource_future( $name, %options )->get
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
FlatFile.pm view on Meta::CPAN
my $classid = "A";
sub new {
my ($class, %opts) = @_;
my $self = {recno => 0};
bless $self => $class;
# acquire object properties from argument list (%opts)
# or from class defaults or default defaults, as appropriate.
# _default will detect missing required values
# and unknown key names
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Foorum/Scraper/MailMan.pm view on Meta::CPAN
sub new {
my $class = shift;
my $self = {};
return bless $self => $class;
}
sub scraper {
my ( $self, $url ) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Function/Interface/Info/Function.pm view on Meta::CPAN
our $VERSION = "0.06";
sub new {
my ($class, %args) = @_;
bless \%args => $class;
}
sub subname() { $_[0]->{subname} }
sub keyword() { $_[0]->{keyword} }
sub params() { $_[0]->{params} }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Function/Return/Info.pm view on Meta::CPAN
use warnings;
sub new {
my $class = shift;
my %args = @_;
bless \%args => $class;
}
sub types { $_[0]->{types} }
1;
view all matches for this distribution
view release on metacpan or search on metacpan
my $gd = shift;
ref($gd) and $gd->isa('GD::Image')
or croak "Not a GD::Image object";
my $self = $class->SUPER::new() or return;
$self->{gd} = $gd;
bless $self => $class;
$self->_init();
$self->set(@_);
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
Graph/Data.pm view on Meta::CPAN
sub new
{
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = [];
bless $self => $class;
$self->copy_from(@_) or return $self->_move_errors if (@_);
return $self;
}
sub DESTROY
view all matches for this distribution
view release on metacpan or search on metacpan
my $self = {
type => 'builtin',
font => gdSmallFont,
ptsize => 10,
};
bless $self => $class;
$self->set(@_) or return;
return $self
}
=head2 GD::Text::error() or $gd_text->error();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Game/Collisions.pm view on Meta::CPAN
my ($class) = @_;
my $self = {
root_aabb => undef,
all_aabbs => {},
};
bless $self => $class;
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
Backgammon.pm view on Meta::CPAN
my $self = {
whitepoints => undef,
blackpoints => undef,
atroll => 'black',
};
bless $self => $class;
$self->_init(%arg);
return $self;
}
sub _init {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Games/Board.pm view on Meta::CPAN
my $board = {
spaces => { }
};
bless $board => $class;
}
#pod =method space
#pod
#pod my $space = $board->space($id);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Games/Bowling/Scorecard.pm view on Meta::CPAN
#pod =cut
sub new {
my ($class) = @_;
my $self = bless { frames => [ ] } => $class;
return $self;
}
#pod =method frames
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Games/Crossword/Puzzle.pm view on Meta::CPAN
#pod =cut
sub from_file {
my ($class, $filename) = @_;
my $self = bless {} => $class;
open my $fh, $filename or die "couldn't open file: $!";
seek $fh, 2, 0;
read $fh, (my $magic), 12;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Games/Goban/Board.pm view on Meta::CPAN
$self->{color} = $args{color};
$self->{notes} = $args{notes};
$self->{move} = $args{move};
bless $self => $class;
}
sub notes { (shift)->{notes} }
sub position { (shift)->current_space_id }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Games/Lacuna/Client/Alliance.pm view on Meta::CPAN
sub new {
my $class = shift;
my %opt = @_;
my $self = $class->SUPER::new(@_);
bless $self => $class;
$self->{alliance_id} = $opt{id};
return $self;
}
__PACKAGE__->init();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Games/Nintendo/Mario.pm view on Meta::CPAN
state => $args{state},
name => $args{name},
$class->_other_defaults
};
bless $plumber => $class;
}
#pod =method powerup
#pod
#pod $hero->powerup('hammer'); # this won't work
view all matches for this distribution
view release on metacpan or search on metacpan
t/050_geocode.t view on Meta::CPAN
package My::Mock;
sub new {
my ($class) = @_;
return bless +{} => $class;
}
package My::Mock::HTTP::Tiny;
use base 'My::Mock';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geography/States.pm view on Meta::CPAN
exists $self -> {cs} -> {$info -> [$i]};
}
}
$self -> {country} = $country;
bless $self => $class;
}
sub state {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Getopt/Class.pm view on Meta::CPAN
# Actually option data are stored in the Getopt::Class::Values object data property
sub TIEHASH
{
my $self = shift( @_ );
my $class = ref( $self ) || $self;
return( bless( { data => {} } => $class ) );
}
sub CLEAR
{
my $self = shift( @_ );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Git/Annex.pm view on Meta::CPAN
"--is-inside-work-tree";
};
exit($output and $output =~ /true/);
}
bless { toplevel => $toplevel } => $class;
}
sub toplevel { shift->{toplevel} }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Git/Github/Creator.pm view on Meta::CPAN
DEBUG( "$key is $Config{$key}" );
}
}
my $opts = $class->_getopt(\@argv);
my $self = bless $opts => $class;
my $meta = $self->_get_metadata;
my $name = $meta->{name};
my $desc = $meta->{desc};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Git/Wrapper.pm view on Meta::CPAN
my( $dir , %opts ) = @_;
$dir = "$dir" if blessed $dir; # we can stringify it for you wholesale
$args = { dir => $dir , %opts }
}
my $self = bless $args => $class;
die "usage: $class->new(\$dir)" unless $self->dir;
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Global/Rainbow/Map.pm view on Meta::CPAN
}
sub new
{
my ($class, %args) = @_;
bless \%args => $class;
}
sub countries
{
my ($self) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Google/Checkout/Command/AddMerchantOrderNumber.pm view on Meta::CPAN
my $self = $class->SUPER::new(
%args,
name => Google::Checkout::XML::Constants::ADD_MERCHANT_ORDER_NUMBER);
$self = bless $self => $class;
$self->set_merchant_order_number($args{merchant_order_number});
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Gopher/Server/TypeMapper.pm view on Meta::CPAN
}
}
no warnings; # Shut off warnings for case where $ext isn't defined
my $self = exists TYPES->{$ext} ? TYPES->{$ext} : TYPES->{default};
bless $self => $class;
}
sub gopher_type { $_[0]->[GOPHER_TYPE] }
sub mime_type { $_[0]->[MIME_TYPE] }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Grammar/Marpa.pm view on Meta::CPAN
$Gargs{ bless_package } = delete $args{ bless_package } if $args{ bless_package };
$Gargs{ trace_file_handle } = $args{ trace_file_handle } if $args{ trace_file_handle };
$ebnf //= delete $args{ source };
$ebnf = $$ebnf if ref($ebnf);
my $G = Marpa::R2::Scanless::G->new({ source => \$ebnf, %Gargs });
return bless [ $G, $pkg, \%args ] => $class;
}
sub parse {
my ($grammar, $string) = @_;
my $R = Marpa::R2::Scanless::R->new({ grammar => $grammar->[ 0 ], semantics_package => $grammar->[ 1 ], %{$grammar->[ 2 ]} });
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Graphics/GVG/OpenGLRenderer.pm view on Meta::CPAN
sub new
{
my ($class) = @_;
my $self = {};
bless $self => $class;
return $self;
}
sub draw {
!;
view all matches for this distribution
view release on metacpan or search on metacpan
Bonobo/Bonobo.pm view on Meta::CPAN
package Bonobo::UnknownImpl;
@ISA = "POA_".CORBA::ORBit::find_interface("IDL:Bonobo/Unknown:1.0");
sub new {
my ($class, @attrs) = @_;
my $self = bless {__repoid => $class->_porbit_repoid, @attrs}, $class;
return $self;
}
# do we actually need to ref/unref here? What about objects we haven't created?
sub ref { }
view all matches for this distribution