Module: Bio::PDB::DataType::Pdb_String
- Defined in:
- lib/bio/db/pdb/pdb.rb
Class Method Summary (collapse)
-
+ (Object) [](nn)
Creates a new module with a string left justified to the length given in nn.
- + (Object) new(str)
Class Method Details
+ (Object) [](nn)
Creates a new module with a string left justified to the length given in nn
98 99 100 101 102 103 104 105 106 107 |
# File 'lib/bio/db/pdb/pdb.rb', line 98 def self.[](nn) m = Module.new m.module_eval %Q{ @@nn = nn def self.new(str) str.to_s.gsub(/\s+\z/, '').ljust(@@nn)[0, @@nn] end } m end |
+ (Object) new(str)
92 93 94 |
# File 'lib/bio/db/pdb/pdb.rb', line 92 def self.new(str) str.to_s.gsub(/\s+\z/, '') end |