Skip to content

Instantly share code, notes, and snippets.

@paneq
Last active December 15, 2015 04:50
Show Gist options
  • Save paneq/5204376 to your computer and use it in GitHub Desktop.
Save paneq/5204376 to your computer and use it in GitHub Desktop.
Dunno what I want to show
class Post
after_create do
Twitter.add_to_stream(self.title)
end
end
class Blog
def post(post_attributes)
post = posts.create!(post_attributes)
Twitter.add_to_stream(post.title)
end
end
class Blog
def post(post_attributes, twitter_client)
post = posts.create!(post_attributes)
twitter_client.add_to_stream(post.title)
end
end
class Blogging
def initialize(blog, twitter_client)
end
def post(post_attributes)
post = @blog.add_post(post_attributes)
@twitter_client.add_to_stream(post.title)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment