Method: Bio::PDB::Utils#finder

Defined in:
lib/bio/db/pdb/utils.rb

#finder(findtype, &block) ⇒ Object

Every class in the heirarchy implements finder, this takes a class which determines which type of object to find, the associated block is then run in classic .find style.

The method might be deprecated. You’d better using find_XXX directly.



201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/bio/db/pdb/utils.rb', line 201

def finder(findtype, &block) #:yields: obj
  if findtype == Bio::PDB::Atom
    return self.find_atom(&block)
  elsif findtype == Bio::PDB::Residue
    return self.find_residue(&block)
  elsif findtype == Bio::PDB::Chain
    return self.find_chain(&block)
  elsif findtype == Bio::PDB::Model
    return self.find_model(&block)
  else
    raise TypeError, "You can't find a #{findtype}"
  end
end