Sha256: 055c5e4e1ecd10f4b997f32fc34cee6b68b31de818da9bb4dd11fc7aa6a65344

Contents?: true

Size: 400 Bytes

Versions: 1

Compression:

Stored size: 400 Bytes

Contents

require "l33tify/version"

module L33tify
  l33t_replacements = {i: '1', r: '2', e: '3', a: '4', s: '5', t: '7', o: '0'}

  def self.process(str)
    str = str.downcase
    new_string = ''
    str.each_char do |c|
      if l33t_replacements[c.to_sym].nil? == false
        new_string += l33t_replacements[c.to_sym]
      else
        new_string += c
      end
    end
    return new_string
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
l33tify-0.0.2 lib/l33tify.rb