Class: String

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

Instance Method Summary collapse

Instance Method Details

#bytesizeObject



19
20
21
# File 'lib/ext/ext.rb', line 19

def bytesize
  size
end

#humanizeObject



14
15
16
# File 'lib/ext/ext.rb', line 14

def humanize
  self.capitalize.gsub(/[-_]+/, ' ')
end

#slugizeObject



10
11
12
# File 'lib/ext/ext.rb', line 10

def slugize
  self.downcase.gsub(/&/, 'and').gsub(/\s+/, '-').gsub(/[^a-z0-9-]/, '')
end