Agile Web Development

Build it. Launch it. Love it.

ActiveRecord 1337

ActiveRecord has gone 1337! This plugin allows you to make everything read out of the database be displayed in h4x0r lingo. The plugin actually contains two components:

  • The module L337 which contains the ability to speak 1337
  • An ActiveRecord::Base extension which allows ActiveRecord to speak 1337

L337

The module L337 contains the methods encode_char, encode_twochar, encode_string and speak.

Usage

  activerecord_1337-0.0.1$ irb -r lib/1337.rb
  irb(main):001:0> L337.speak 'hacker'
  => "h4x0r"
  irb(main):002:0> L337.encode_string 'hacker'
  => "h4x0r"
  irb(main):003:0> L337.encode_char 'a'
  => "4"
  irb(main):004:0> L337.encode_twochar 'er'
  => "0r"

ActiveRecord 1337 Sample

  irb(main):002:0> t=Topic.create :title=>'The Sword Of Shannara', :author_name=>'Terry Brooks'
  => #>, @attributes={"author_name"=>"Terry Brooks", "title"=>"The Sword Of Shannara", "type"=>nil, "id"=>3, "approved"=>true, "replies_count"=>0, "bonus_time"=>nil, "content"=>nil, "written_on"=>nil, "author_email_address"=>nil, "parent_id"=>nil, "last_read"=>nil}, @new_record=false>
  irb(main):003:0> t.author_name
  => "70rrj 8r00X5"
  irb(main):004:0> t.title
  => "7h3 5\\/\\/0rd 0|= 5h4nn4r4"

Vitals

Home http://blogs.mktec.com/zdennis/pages/ActiveRecord_1337
License
Tags Tag_red
Rating (6 votes)
Created 11 August 2006

Comments

Add a comment