Skip to content

Instantly share code, notes, and snippets.

@kevinrutherford
Created July 7, 2012 09:59
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kevinrutherford/3065695 to your computer and use it in GitHub Desktop.
The Self Shunt
class PublishesPosts < Struct.new(:post_id, :ui)
def run
Blog.lookup_post(post_id, self)
end
def post_found(post)
post.publish
ui.post_published(post)
end
def no_such_post(post_id)
ui.no_such_post(post_id)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment