Skip to content

Instantly share code, notes, and snippets.

@kblake
Created September 24, 2010 20:19
Show Gist options
  • Save kblake/595961 to your computer and use it in GitHub Desktop.
Save kblake/595961 to your computer and use it in GitHub Desktop.
# post.rb ############
module Commentable
attr_accessor :comments
def setup_comments
@comments ||= []
end
def add_comment(comment)
@comments << comment
end
# remove comment
# sorted comments
# find comment
end
# create a Post class with a title and body attributes. make it commentable using the Commentable module
# test drive the code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment