Class: GithubStats::IssueIngester

Inherits:
Object
  • Object
show all
Defined in:
lib/github_stats/issue_ingester.rb

Overview

Retrieves issues from Github and upserts them into the database.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(search_string, options) ⇒ IssueIngester

Returns a new instance of IssueIngester.



7
8
9
10
# File 'lib/github_stats/issue_ingester.rb', line 7

def initialize(search_string, options)
  self.search_string = search_string
  self.options = options
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



5
6
7
# File 'lib/github_stats/issue_ingester.rb', line 5

def options
  @options
end

#search_stringObject

Returns the value of attribute search_string.



5
6
7
# File 'lib/github_stats/issue_ingester.rb', line 5

def search_string
  @search_string
end

Instance Method Details

#ingestObject



12
13
14
15
# File 'lib/github_stats/issue_ingester.rb', line 12

def ingest
  return unless options[:ingest]
  github.search_issues(search_string).items.each(&method(:insert_or_update))
end