Class: Tmxnews::Article

Inherits:
Object
  • Object
show all
Defined in:
lib/tmxnews/article.rb

Constant Summary collapse

@@all =
[]

Class Method Summary collapse

Class Method Details

.articlesObject



5
6
7
8
9
# File 'lib/tmxnews/article.rb', line 5

def self.articles
  @@all << Tmxnews::Scraper.scrape_nyt
  @@all << Tmxnews::Scraper.scrape_wsj
  @@all
end

.list_articlesObject



11
12
13
14
15
16
# File 'lib/tmxnews/article.rb', line 11

def self.list_articles
    articles.each.with_index(1) do |article, i|
    puts "#{i}. #{article.title}"
    puts
    end
end