Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.