Skip to content

Instantly share code, notes, and snippets.

@babney
Created April 3, 2012 16:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save babney/2293388 to your computer and use it in GitHub Desktop.
Save babney/2293388 to your computer and use it in GitHub Desktop.
Like, Ruby
module LikeRuby
VALLEYGIRL = %w[omg so like totally right toootally stuff]
FRATGUY = %w[friggin fuckin dude man bro broheim broseph]
INTERNETS = %w[lol rofl teh ohai plz]
SNOOP = %w[yo homey homeboy sup dog shit girl ma biatch ho shiiit]
LOCAL = %w[wicked hella anyways]
MISC = %w[just hey yeah ok um uh ah actually something]
ALLSLANG = VALLEYGIRL + FRATGUY + INTERNETS + SNOOP + LOCAL + MISC
def method_missing(name, *args)
if ALLSLANG.include?(name.to_s)
if !args[0].nil?
if args[0].is_a? Symbol
self.send(args[0], *args[1..-1])
else
return args[0]
end
end
else
super
end
end
end
class Object
include LikeRuby
end
@babney
Copy link
Author

babney commented Apr 3, 2012

1.9.2p290 :028 > ok so like String.new("Foo") or something
=> "Foo"
1.9.2p290 :029 > um actually 5+6 and stuff
=> nil

@mohnish
Copy link

mohnish commented Apr 3, 2012

👍

@babney
Copy link
Author

babney commented Apr 3, 2012

Lots of bugs, not nearly as clean as Like, Python yet but it doesn't rely on an external interpreter.

@usmanity
Copy link

usmanity commented Apr 3, 2012

ree-1.8.7-2011.12 :028 > hella puts "dope "*10
dope dope dope dope dope dope dope dope dope dope 
 => nil 

Being able to use hella as a part of code...dope.

@voltechs
Copy link

voltechs commented Jul 7, 2014

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment