Skip to content

Instantly share code, notes, and snippets.

@caike
Created November 28, 2012 15:43
Show Gist options
  • Save caike/4162063 to your computer and use it in GitHub Desktop.
Save caike/4162063 to your computer and use it in GitHub Desktop.
Tell, Don't Ask.
class SomeClass
def some_method(obj)
if obj.foo
obj.bar
end
end
end
class SomeOtherClass
def foo; end
def bar; end
end
class SomeClass
def some_method(obj)
obj.foo_bar
end
end
class SomeOtherClass
def foo_bar
if foo
bar
end
end
private
def foo; end
def bar; end
end
@ericallam
Copy link

Not enough banana

@olivierlacan
Copy link

^ 👍 What he said.

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