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