class Article

Attributes

author[RW]
content[RW]
subtitle[RW]
title[RW]

Public Class Methods

all() click to toggle source
# File lib/article.rb, line 18
def self.all
  @@all
end
new() click to toggle source
# File lib/article.rb, line 5
def initialize
  @@all << self
end
new_from_hash(hash) click to toggle source
# File lib/article.rb, line 9
def self.new_from_hash(hash)
  article = Article.new
  hash.each do |attribute, value|
    article.send("#{attribute}=", value)
  end

  article.content = article.content.reject {|para| para.text==""}
end
reset_all() click to toggle source
# File lib/article.rb, line 22
def self.reset_all
  @@all = []
end