Module: Bio::PDB::DataType::Pdb_LString

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

Overview

module Pdb_String

Class Method Summary collapse

Class Method Details

.[](nn) ⇒ Object


112
113
114
115
116
117
118
119
120
121
# File 'lib/bio/db/pdb/pdb.rb', line 112

def self.[](nn)
  m = Module.new
  m.module_eval %Q{
    @@nn = nn
    def self.new(str)
      str.to_s.ljust(@@nn)[0, @@nn]
    end
  }
  m
end

.new(str) ⇒ Object


122
123
124
# File 'lib/bio/db/pdb/pdb.rb', line 122

def self.new(str)
  String.new(str.to_s)
end