class GithubSearch::Searcher
Public Instance Methods
issues()
click to toggle source
# File lib/github-search/searcher.rb, line 16 def issues @path = "issues" @model = Issue self end
repos()
click to toggle source
# File lib/github-search/searcher.rb, line 22 def repos @path = "repositories" @model = Repository self end
search(*args, opts)
click to toggle source
# File lib/github-search/searcher.rb, line 7 def search(*args, opts) search_string_builder = SearchStringBuilder.new search_string = search_string_builder.build_search_string(args, opts, @model) response = Faraday.get("#{API_URL}/#{@path}#{search_string}") items = JSON.parse(response.body)["items"] items.map { |attributes| @model.new(attributes) } end
users()
click to toggle source
# File lib/github-search/searcher.rb, line 28 def users @path = "users" @model = User self end