Skip to content
Browse files

updated README with examples

  • Loading branch information...
1 parent 3087d92 commit 5b1503634b857cf68cda1d0efcb0cd7d47e791d6 @igrigorik committed Dec 12, 2009
Showing with 34 additions and 33 deletions.
  1. +34 −33 README
View
67 README
@@ -1,37 +1,38 @@
Ruby2Lolz translates Ruby code into LOLCODE (http://www.lolcode.com)
-
-For example:
-
-class Simple
- def add(n1, n2)
- return n1 + n2
+- http://www.igvita.com/2008/12/11/ruby-ast-for-fun-and-profit/
+
+== Translating Ruby Hash & Array:
+ require 'ruby2lolz'
+ # adds Hash.to_lolz, and Array.to_lolz
+
+ puts {:nickname => [:ig, :igrigorik]}.to_lolz
+
+ OH HAI
+ I CAN HAS Nickname
+ I CAN MANY HAZ
+ AWSUM VAR
+ ig
+ KTHNX.
+ AWSUM VAR
+ igrigorik
+ KTHNX.
+ KTHNXBYE.
+ KTHNX.
+ KTHNXBYE.
+
+Put some Lolz into your API
+- http://pastie.org/327494
+
+== Translating a class:
+
+ class Simple
+ def add(n1, n2)
+ return n1 + n2
+ end
end
-end
-
-Ruby2Lolz.translate(Simple, :add)
-
-HOW DUZ I HAZ add [YR n1, YR n2]
- (n1 + n2)
-IF U SAY SO
-
-### OR ###
-
-> Ruby2Lolz.translate({:nickname => [:ig, :igrigorik]}.inspect)
-
-OH HAI
- I CAN HAS Nickname
- I CAN MANY HAZ
- AWSUM VAR
- ig
- KTHNX.
- AWSUM VAR
- igrigorik
- KTHNX.
- KTHNXBYE.
- KTHNX.
-KTHNXBYE.
-### OR ###
+ Ruby2Lolz.translate(Simple, :add)
-Put some Lolz into your API!
- - http://pastie.org/327494
+ HOW DUZ I HAZ add [YR n1, YR n2]
+ (n1 + n2)
+ IF U SAY SO

0 comments on commit 5b15036

Please sign in to comment.
Something went wrong with that request. Please try again.