-
-
Save practicingruby/1763981 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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