BACKTRACE

(condense)

Back to Posts List

GET

String boolean: MethodMissing fun!

Check out this one, this is way i love rails.


elad = “smart”
elad.smart? # => true


using method_missing on the String object


def method_missing(method_name, *arguments)
if method_name.to_s.ends_with?(“?”)
self == method_name.to_s[0..-2]
else
super
end
end

POST

blog comments powered by Disqus

I Don't have cookies.

ELAD ENV

Variable Value
LINKEDIN
TWITTER
FACEBOOK
GITHUB
WWR
IRC
{ 'irc.freenode.net' => [ '#rubyonrails', '#railsbridge', '#ruby', '#mootools' ]}
SKYPE
eladmeidar

You're seeing this error because I think it is funny.