Class: Cline::Collectors::Github
- Defined in:
- lib/cline/collectors/github.rb
Defined Under Namespace
Classes: Activity
Class Method Summary collapse
Instance Method Summary collapse
- #activities ⇒ Object
-
#initialize(name) ⇒ Github
constructor
A new instance of Github.
Methods inherited from Base
Constructor Details
#initialize(name) ⇒ Github
Returns a new instance of Github.
23 24 25 26 27 28 |
# File 'lib/cline/collectors/github.rb', line 23 def initialize(name) require 'open-uri' require 'uri' @api_url = URI.parse("https://api.github.com/users/#{name}/received_events") end |
Class Method Details
.collect ⇒ Object
6 7 8 9 10 |
# File 'lib/cline/collectors/github.rb', line 6 def collect new(login_name).activities.each do |, notified_at| create_or_pass , notified_at end end |
.login_name ⇒ Object
16 17 18 |
# File 'lib/cline/collectors/github.rb', line 16 def login_name @login_name end |
.login_name=(name) ⇒ Object
12 13 14 |
# File 'lib/cline/collectors/github.rb', line 12 def login_name=(name) @login_name = name end |
Instance Method Details
#activities ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/cline/collectors/github.rb', line 30 def activities events = JSON.parse(@api_url.read) events.map { |event| = (event) next unless [, event['created_at']] }.compact end |