class KdnuggetsRoundup::Article

Attributes

author[RW]
excerpt[RW]
shared[RW]
summary[RW]
tags[RW]
title[RW]
url[RW]

Public Class Methods

all() click to toggle source
# File lib/article.rb, line 38
def self.all
  @@all
end
find_by_title(title) click to toggle source
# File lib/article.rb, line 18
def self.find_by_title(title)
  all.detect{|story| story.title == title}
end
new(title, url) click to toggle source
# File lib/article.rb, line 6
def initialize(title, url)
  @title = title
  @url = url
  @popular = false
  @shared = false
  @@all << self
end
shared() click to toggle source
# File lib/article.rb, line 34
def self.shared
  all.select{|a| a.shared}
end

Public Instance Methods

add_to_shared() click to toggle source
# File lib/article.rb, line 26
def add_to_shared
  @shared = true
end
assign_attributes(attribute_hash) click to toggle source
# File lib/article.rb, line 14
def assign_attributes(attribute_hash)
  attribute_hash.each{|k, v| self.send("#{k}=", v)}
end