Skip to content

Commit

Permalink
updated README with examples
Browse files Browse the repository at this point in the history
  • Loading branch information
igrigorik committed Dec 12, 2009
1 parent 3087d92 commit 5b15036
Showing 1 changed file with 34 additions and 33 deletions.
67 changes: 34 additions & 33 deletions README
@@ -1,37 +1,38 @@
Ruby2Lolz translates Ruby code into LOLCODE (http://www.lolcode.com) Ruby2Lolz translates Ruby code into LOLCODE (http://www.lolcode.com)

- http://www.igvita.com/2008/12/11/ruby-ast-for-fun-and-profit/
For example:

== Translating Ruby Hash & Array:
class Simple require 'ruby2lolz'
def add(n1, n2) # adds Hash.to_lolz, and Array.to_lolz
return n1 + n2
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
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! HOW DUZ I HAZ add [YR n1, YR n2]
- http://pastie.org/327494 (n1 + n2)
IF U SAY SO

0 comments on commit 5b15036

Please sign in to comment.