Module: RepoParser

Defined in:
lib/repo_parser.rb,
lib/repo_parser/version.rb

Overview

RepoParser is a coding test involving scraping some github json, and sorting it.

Defined Under Namespace

Classes: Fetcher, Filterer, Parser, Repository, Result, Sorter

Constant Summary collapse

VERSION =
'0.0.3'

Class Method Summary collapse

Class Method Details

.chain(*processors) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/repo_parser.rb', line 13

def self.chain(*processors)
  # the first is called with no args
  value = processors.shift.call

  processors.each do |proc|
    value = proc.call(value)
  end

  value
end

.runObject



8
9
10
11
# File 'lib/repo_parser.rb', line 8

def self.run
  repos = chain(Fetcher, Parser, Filterer, Sorter)
  Result.new(repos)
end