Class: Planetruby2feed::Base

Inherits:
Object
  • Object
show all
Includes:
Parser, Scraper
Defined in:
lib/planetruby2feed.rb

Instance Attribute Summary collapse

Attributes included from Scraper

#webpage

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Parser

#find_posts

Methods included from Scraper

#analyze, #get_page

Constructor Details

#initializeBase

Returns a new instance of Base.



16
17
18
19
20
# File 'lib/planetruby2feed.rb', line 16

def initialize
  @logger = Logger.new(STDOUT)
  @logger.level = Logger::WARN
  @posts = []
end

Instance Attribute Details

#postsObject

Returns the value of attribute posts.



14
15
16
# File 'lib/planetruby2feed.rb', line 14

def posts
  @posts
end

Class Method Details

.run!Object



22
23
24
25
26
27
28
# File 'lib/planetruby2feed.rb', line 22

def self.run!
  @planet = self.new
  @planet.get_page
  @planet.find_posts
  Planetruby2feed::Webserver.set :posts, @planet.posts
  Planetruby2feed::Webserver.run!
end