lib/bio/db/kegg/pathway.rb in bio-1.4.3.0001 vs lib/bio/db/kegg/pathway.rb in bio-1.5.0
- old
+ new
@@ -3,11 +3,10 @@
#
# Copyright:: Copyright (C) 2010 Kozo Nishida <kozo-ni@is.naist.jp>
# Copyright:: Copyright (C) 2010 Toshiaki Katayama <k@bioruby.org>
# License:: The Ruby License
#
-# $Id:$
#
require 'bio/db'
require 'bio/db/kegg/common'
@@ -125,11 +124,11 @@
# Diseases described in the DISEASE lines.
# ---
# *Returns*:: Hash of disease ID and its definition
def diseases_as_hash
- unless @diseases_as_hash
+ unless (defined? @diseases_as_hash) && @diseases_as_hash
@diseases_as_hash = strings_as_hash(diseases_as_strings)
end
@diseases_as_hash
end
alias diseases diseases_as_hash
@@ -164,11 +163,11 @@
# Genes described in the GENE lines.
# ---
# *Returns*:: Hash of gene ID and its definition
def genes_as_hash
- unless @genes_as_hash
+ unless (defined? @genes_as_hash) && @genes_as_hash
@genes_as_hash = strings_as_hash(genes_as_strings)
end
@genes_as_hash
end
alias genes genes_as_hash
@@ -190,11 +189,11 @@
# Reactions described in the REACTION lines.
# ---
# *Returns*:: Hash of reaction ID and its definition
def reactions_as_hash
- unless @reactions_as_hash
+ unless (defined? @reactions_as_hash) && @reactions_as_hash
@reactions_as_hash = strings_as_hash(reactions_as_strings)
end
@reactions_as_hash
end
alias reactions reactions_as_hash
@@ -208,10 +207,10 @@
# Compounds described in the COMPOUND lines.
# ---
# *Returns*:: Hash of compound ID and its definition
def compounds_as_hash
- unless @compounds_as_hash
+ unless (defined? @compounds_as_hash) && @compounds_as_hash
@compounds_as_hash = strings_as_hash(compounds_as_strings)
end
@compounds_as_hash
end
alias compounds compounds_as_hash