class Bio::References
DESCRIPTION¶ ↑
This class is OBSOLETED, and will soon be removed. Instead of this class, an array is to be used.
A container class for Bio::Reference objects.
USAGE¶ ↑
This class should NOT be used.
refs = Bio::References.new refs.append(Bio::Reference.new(hash)) refs.each do |reference| ... end
Attributes
Array of Bio::Reference objects
Public Class Methods
Source
# File lib/bio/compat/references.rb 77 def self.new(ary = []) 78 warn 'Bio::References is obsoleted. Some methods are added to given array to keep backward compatibility.' 79 ary.extend(BackwardCompatibility) 80 ary 81 end
This method should not be used. Only for backward compatibility of existing code.
Since Bio::References is obsoleted, Bio::References.new not returns Bio::References object, but modifies given ary and returns the ary.
Arguments:
-
(optional) __: Array of
Bio::Referenceobjects
- Returns
-
the given array
Source
# File lib/bio/compat/references.rb 95 def initialize(ary = []) 96 @references = ary 97 end
Normally, users can not call this method.
Create a new Bio::References object
refs = Bio::References.new
Arguments:
-
(optional) __: Array of
Bio::Referenceobjects
- Returns
-
Bio::Referencesobject
Public Instance Methods
Source
# File lib/bio/compat/references.rb 107 def append(reference) 108 @references.push(reference) if reference.is_a? Reference 109 return self 110 end
Add a Bio::Reference object to the container.
refs.append(reference)
Arguments:
-
(required) reference:
Bio::Referenceobject
- Returns
-
current
Bio::Referencesobject
Source
# File lib/bio/compat/references.rb 119 def each 120 @references.each do |reference| 121 yield reference 122 end 123 end
Iterate through Bio::Reference objects.
refs.each do |reference| ... end
- Block
-
yields each
Bio::Referenceobject