Skip to content

Instantly share code, notes, and snippets.

@TheEmpty
Created October 8, 2014 16:49
Show Gist options
  • Select an option

  • Save TheEmpty/0710ac12b56cb1881e85 to your computer and use it in GitHub Desktop.

Select an option

Save TheEmpty/0710ac12b56cb1881e85 to your computer and use it in GitHub Desktop.
class A
def isVisable
true
end
def method_missing(m, *args, &block)
if m =~ /eh$/i
merica = "is" + m.to_s.capitalize.split(/eh$/i).first
if self.respond_to?(merica)
return self.send(merica)
end
end
super
end
end
a = A.new
puts a.isVisable
puts a.visableEh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment