Module: Octokit::Client::Search

Included in:
Octokit::Client
Defined in:
lib/octokit/client/search.rb

Overview

Methods for the Search API

Instance Method Summary collapse

Instance Method Details

#search_code(query, options = {}) ⇒ Sawyer::Resource

Search code

Parameters:

  • query (String)

    Search term and qualifiers

  • options (Hash) (defaults to: {})

    Sort and pagination options

Options Hash (options):

  • :sort (String)

    Sort field

  • :order (String)

    Sort order (asc or desc)

  • :page (Fixnum)

    Page of paginated results

  • :per_page (Fixnum)

    Number of items per page

Returns:

  • (Sawyer::Resource)

    Search results object

See Also:



19
20
21
# File 'lib/octokit/client/search.rb', line 19

def search_code(query, options = {})
  search "/search/code", query, options
end

#search_issues(query, options = {}) ⇒ Sawyer::Resource

Search issues

Parameters:

  • query (String)

    Search term and qualifiers

  • options (Hash) (defaults to: {})

    Sort and pagination options

Options Hash (options):

  • :sort (String)

    Sort field

  • :order (String)

    Sort order (asc or desc)

  • :page (Fixnum)

    Page of paginated results

  • :per_page (Fixnum)

    Number of items per page

Returns:

  • (Sawyer::Resource)

    Search results object

See Also:



33
34
35
# File 'lib/octokit/client/search.rb', line 33

def search_issues(query, options = {})
  search "/search/issues", query, options
end

#search_repositories(query, options = {}) ⇒ Sawyer::Resource Also known as: search_repos

Search repositories

Parameters:

  • query (String)

    Search term and qualifiers

  • options (Hash) (defaults to: {})

    Sort and pagination options

Options Hash (options):

  • :sort (String)

    Sort field

  • :order (String)

    Sort order (asc or desc)

  • :page (Fixnum)

    Page of paginated results

  • :per_page (Fixnum)

    Number of items per page

Returns:

  • (Sawyer::Resource)

    Search results object

See Also:



47
48
49
# File 'lib/octokit/client/search.rb', line 47

def search_repositories(query, options = {})
  search "/search/repositories", query, options
end

#search_users(query, options = {}) ⇒ Sawyer::Resource

Search users

Parameters:

  • query (String)

    Search term and qualifiers

  • options (Hash) (defaults to: {})

    Sort and pagination options

Options Hash (options):

  • :sort (String)

    Sort field

  • :order (String)

    Sort order (asc or desc)

  • :page (Fixnum)

    Page of paginated results

  • :per_page (Fixnum)

    Number of items per page

Returns:

  • (Sawyer::Resource)

    Search results object

See Also:



62
63
64
# File 'lib/octokit/client/search.rb', line 62

def search_users(query, options = {})
  search "/search/users", query, options
end