Skip to content
Snippets Groups Projects
Commit ff5a50b6 authored by Daniel Rios's avatar Daniel Rios
Browse files

added method new_fast to allow quick creation of objects avoiding rearrange method

parent 320d2a58
No related branches found
No related tags found
No related merge requests found
=head1 LICENSE
#
# Ensembl module for Bio::EnsEMBL::Attribute
#
# Copyright (c) 2004 Ensembl
#
# You may distribute this module under the same terms as perl itself
Copyright (c) 1999-2009 The European Bioinformatics Institute and
Genome Research Limited. All rights reserved.
This software is distributed under a modified Apache license.
For license details, please see
http://www.ensembl.org/info/about/code_licence.html
=head1 CONTACT
Please email comments or questions to the public Ensembl
developers list at <ensembl-dev@ebi.ac.uk>.
Questions may also be sent to the Ensembl help desk at
<helpdesk@ensembl.org>.
=cut
# POD documentation - main docs before the code
=head1 NAME
......@@ -26,17 +15,16 @@ Bio::EnsEMBL::Attribute - A generic Attribute class.
use Bio::EnsEMBL::Attribute;
my $attribute = Bio::EnsEMBL::Attribute->new(
-CODE => 'myCode',
-NAME => 'My Attribute',
-DESCRIPTION => 'This is my attribute description.',
-VALUE => '10023'
);
my $attribute = Bio::EnsEMBL::Attribute->new
(-CODE => 'myCode',
-NAME => 'My Attribute',
-DESCRIPTION => 'This is my attribute description.',
-VALUE => '10023');
print $attrib->name(), "\n";
print $attrib->code(), "\n";
print $attrib->name(), "\n";
print $attrib->code(), "\n";
print $attrib->description(), "\n";
print $attrib->value(), "\n";
print $attrib->value(), "\n";
=head1 DESCRIPTION
......@@ -46,6 +34,13 @@ associated with seq_regions (and their Slices) and MiscFeatures.
Also see B<Bio::EnsEMBL::Slice>, B<Bio::EnsEMBL::MiscFeature> and
B<Bio::EnsEMBL::DBSQL::AttributeAdaptor>.
=head1 CONTACT
This modules is part of the Ensembl project http://www.ensembl.org
Questions can be posted to the ensembl-dev mailing list:
ensembl-dev@ebi.ac.uk
=head1 METHODS
=cut
......@@ -88,10 +83,28 @@ sub new {
return bless {'code' => $code,
'name' => $name,
'description' => $desc,
'description' => $desc,
'value' => $value}, $class;
}
=head2 new_fast
Arg [1] : hashref to be blessed
Description: Construct a new Bio::EnsEMBL::Attribute using the hashref.
Exceptions : none
Returntype : Bio::EnsEMBL::Attribute
Caller : general, subclass constructors
Status : Stable
=cut
sub new_fast {
my $class = shift;
my $hashref = shift;
return bless $hashref, $class;
}
=head2 code
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment