class BerkleeValencia::ARTICLE

Attributes

author[RW]
body[RW]
category[RW]
date[RW]
excerpt[RW]
i[RW]

Public Class Methods

all() click to toggle source
# File lib/berklee_valencia/article.rb, line 21
def self.all
  @@all
end
new_from_scraper(attribute_hash) click to toggle source
# File lib/berklee_valencia/article.rb, line 5
def self.new_from_scraper(attribute_hash)
  BerkleeValencia::ARTICLE.new(attribute_hash[:title], attribute_hash[:url]).tap do |article|
    article.category = attribute_hash[:category]
    article.date = attribute_hash[:date]
    article.excerpt = attribute_hash[:excerpt]
    @@all << article
    BerkleeValencia::CATEGORY.find_or_create_from_article(article)
  end
end

Public Instance Methods

extended_info_from_scraper(attribute_hash) click to toggle source
# File lib/berklee_valencia/article.rb, line 15
def extended_info_from_scraper(attribute_hash)
  @author = attribute_hash[:author]
  @related_links = attribute_hash[:related_links]
  @body = attribute_hash[:body]
end