Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Forked from HeroicEric/gist:1763972
Created February 8, 2012 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save practicingruby/1763981 to your computer and use it in GitHub Desktop.
Save practicingruby/1763981 to your computer and use it in GitHub Desktop.
class Blog
attr_reader :entries
attr_accessor :post_class
def initialize
@entries = []
end
def title
"Underwater Basketweaving"
end
def subtitle
"The best way to spend your time, all the time"
end
def new_post
post = (post_class || Post).new
post.blog = self
post
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment