Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
8dd423fb
Commit
8dd423fb
authored
17 years ago
by
Patrick Meidl
Browse files
Options
Downloads
Patches
Plain Diff
added autoload capabilities
parent
989f9356
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/IdMapping/Serialisable.pm
+17
-1
17 additions, 1 deletion
modules/Bio/EnsEMBL/IdMapping/Serialisable.pm
with
17 additions
and
1 deletion
modules/Bio/EnsEMBL/IdMapping/Serialisable.pm
+
17
−
1
View file @
8dd423fb
...
...
@@ -43,7 +43,8 @@ sub new {
my
$caller
=
shift
;
my
$class
=
ref
(
$caller
)
||
$caller
;
my
(
$dump_path
,
$cache_file
)
=
rearrange
([
qw(DUMP_PATH CACHE_FILE)
],
@
_
);
my
(
$dump_path
,
$cache_file
,
$auto_load
)
=
rearrange
([
qw(DUMP_PATH CACHE_FILE AUTO_LOAD)
],
@
_
);
throw
("
You must provide a cache file name
")
unless
(
$cache_file
);
...
...
@@ -55,6 +56,14 @@ sub new {
$self
->
{'
cache_file
'}
=
$self
->
dump_path
.
"
/
$cache_file
";
$self
->
{'
cache_file_name
'}
=
$cache_file
;
# automatically load serialised object from file if requested
if
(
$auto_load
)
{
if
(
-
s $self->cache_file) {
$self->read_from_file;
$s
elf
->
{'
loaded
'}
=
1
;
}
}
return
$self
;
}
...
...
@@ -125,5 +134,12 @@ sub cache_file_name {
}
sub
loaded
{
my
$self
=
shift
;
$self
->
{'
loaded
'}
=
shift
if
(
@
_
);
return
$self
->
{'
loaded
'};
}
1
;
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment