Class: MyTimeline::Github::GithubScraper
- Inherits:
-
Object
- Object
- MyTimeline::Github::GithubScraper
- Defined in:
- app/scrapers/my_timeline/github/github_scraper.rb
Constant Summary collapse
- VALID_EVENTS =
IMPLEMENTED EVENTS ONLY:
%w{ForkEvent PullRequestEvent}.freeze
Instance Attribute Summary collapse
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(user) ⇒ GithubScraper
constructor
A new instance of GithubScraper.
- #scrape ⇒ Object
Constructor Details
#initialize(user) ⇒ GithubScraper
Returns a new instance of GithubScraper.
16 17 18 |
# File 'app/scrapers/my_timeline/github/github_scraper.rb', line 16 def initialize(user) @user = user end |
Instance Attribute Details
#user ⇒ Object
Returns the value of attribute user.
14 15 16 |
# File 'app/scrapers/my_timeline/github/github_scraper.rb', line 14 def user @user end |
Instance Method Details
#scrape ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/scrapers/my_timeline/github/github_scraper.rb', line 20 def scrape @count = 0 events.each do |event| if should_build? event Rails.logger.fatal "buidling #{event.type}" @count = @count + 1 if "MyTimeline::Github::#{event.type}Builder".constantize.new(user, event).build_event end end @count end |