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 (Integer)

    Page of paginated results

  • :per_page (Integer)

    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_commits(query, options = {}) ⇒ Sawyer::Resource

Search commits

Parameters:

  • query (String)

    Search terms 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 (Integer)

    Page of paginated results

  • :per_page (Integer)

    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_commits(query, options = {})
  search 'search/commits', 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 (Integer)

    Page of paginated results

  • :per_page (Integer)

    Number of items per page

Returns:

  • (Sawyer::Resource)

    Search results object

See Also:



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

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 (Integer)

    Page of paginated results

  • :per_page (Integer)

    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_repositories(query, options = {})
  search 'search/repositories', query, options
end

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

Search topics

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 (Integer)

    Page of paginated results

  • :per_page (Integer)

    Number of items per page

Returns:

  • (Sawyer::Resource)

    Search results object

See Also:



77
78
79
# File 'lib/octokit/client/search.rb', line 77

def search_topics(query, options = {})
  search 'search/topics', 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 (Integer)

    Page of paginated results

  • :per_page (Integer)

    Number of items per page

Returns:

  • (Sawyer::Resource)

    Search results object

See Also:



91
92
93
# File 'lib/octokit/client/search.rb', line 91

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