class GoodNews::Topic

Attributes

articles[RW]
name[RW]
web_addr[RW]

Public Class Methods

all() click to toggle source

Class method to get all topics.

# File lib/good_news/topic.rb, line 13
def self.all
    @@all
end
new() click to toggle source

Instantiates with an article attribute to store all articles of the topic.

# File lib/good_news/topic.rb, line 8
def initialize
    @articles = []
end

Public Instance Methods

save() click to toggle source

Method to save topic object into @@all.

# File lib/good_news/topic.rb, line 18
def save
    @@all << self
end