Class: String

Inherits:
Object show all
Defined in:
lib/basic/basic.rb

Direct Known Subclasses

FileName

Instance Method Summary collapse

Instance Method Details

#addslashesObject


60
61
62
# File 'lib/basic/basic.rb', line 60

def addslashes
	gsub(/['"\\\x0]/,'\\\\\0')
end

#addslashes!Object


64
65
66
# File 'lib/basic/basic.rb', line 64

def addslashes!
	replace addslashes
end

#pad(size, char) ⇒ Object


55
56
57
58
# File 'lib/basic/basic.rb', line 55

def pad size, char
	size -= length
	if size > 0 then replace self+(char*size) end
end

#write(filename = nil) ⇒ Object


68
69
70
# File 'lib/basic/basic.rb', line 68

def write filename = nil
	write_file( filename ){ self }
end