Module: Croudia::API::Search

Included in:
Client
Defined in:
lib/croudia/api/search.rb

Instance Method Summary collapse

Instance Method Details

#search(q, params = {}) ⇒ Croudia::SearchResults #search(params = {}) ⇒ Croudia::SearchResults

Search for statuses

Overloads:

  • #search(q, params = {}) ⇒ Croudia::SearchResults

    Parameters:

    • q (String)

      Search query

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

      Additional query parameters

    Options Hash (params):

    • :count (String, Integer)

      Number of statuses in the response

    • :include_entities (String)

      Set false to exclude entities

    • :max_id (String, Integer)

      Paging parameter

    • :since_id (String, Integer)

      Paging parameter

    • :trim_user (String)

      Set true to return compact user objects

  • #search(params = {}) ⇒ Croudia::SearchResults

    Parameters:

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

      Query parameters

    Options Hash (params):

    • :q (String)

      Search query

    • :count (String, Integer)

      Number of statuses in the response

    • :include_entities (String)

      Set false to exclude entities

    • :max_id (String, Integer)

      Paging parameter

    • :since_id (String, Integer)

      Paging parameter

    • :trim_user (String)

      Set true to return compact user objects

Returns:

See Also:



27
28
29
30
31
# File 'lib/croudia/api/search.rb', line 27

def search(q, params={})
  merge_query!(params, q)
  resp = get('/search/voices.json', params)
  Croudia::SearchResults.new(resp)
end

#search_favorites(q, params = {}) ⇒ Croudia::SearchResults #search_favorites(params = {}) ⇒ Croudia::SearchResults

Search for statuses the authenticated user has favorited

Overloads:

  • #search_favorites(q, params = {}) ⇒ Croudia::SearchResults

    Parameters:

    • q (String)

      Search query

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

      Additional query parameters

    Options Hash (params):

    • :count (String, Integer)

      Number of statuses in the response

    • :include_entities (String)

      Set false to exclude entities

    • :max_id (String, Integer)

      Paging parameter

    • :since_id (String, Integer)

      Paging parameter

    • :trim_user (String)

      Set true to return compact user objects

  • #search_favorites(params = {}) ⇒ Croudia::SearchResults

    Parameters:

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

      Query parameters

    Options Hash (params):

    • :q (String)

      Search query

    • :count (String, Integer)

      Number of statuses in the response

    • :include_entities (String)

      Set false to exclude entities

    • :max_id (String, Integer)

      Paging parameter

    • :since_id (String, Integer)

      Paging parameter

    • :trim_user (String)

      Set true to return compact user objects

Returns:

See Also:



101
102
103
104
105
# File 'lib/croudia/api/search.rb', line 101

def search_favorites(q, params={})
  merge_query!(params, q)
  resp = get('/search/favorites.json', params)
  Croudia::SearchResults.new(resp)
end

#search_user(q, params = {}) ⇒ Array<Croudia::User> #search_user(params = {}) ⇒ Array<Croudia::User> Also known as: search_users

Search for users

Overloads:

  • #search_user(q, params = {}) ⇒ Array<Croudia::User>

    Parameters:

    • q (String)

      Search query

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

      Additional query parameters

    Options Hash (params):

    • :count (String, Integer)

      Number of users in the response

    • :include_entities (String)

      Set false to exclude entities

    • :max_id (String, Integer)

      Paging parameter

    • :since_id (String, Integer)

      Paging parameter

    • :trim_user (String)

      Set true to return compact user objects

  • #search_user(params = {}) ⇒ Array<Croudia::User>

    Parameters:

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

      Query parameters

    Options Hash (params):

    • :q (String)

      Search query

    • :count (String, Integer)

      Number of users in the response

    • :page (String, Integer)

      Page to fetch, up to 1000

    • :trim_user (String)

      Set true to return compact user objects

Returns:

See Also:



51
52
53
54
55
# File 'lib/croudia/api/search.rb', line 51

def search_user(q, params={})
  merge_query!(params, q)
  resp = get('/users/search.json', params)
  objects(Croudia::User, resp)
end

#search_user_by_profile(q, params = {}) ⇒ Array<Croudia::User> #search_user_by_profile(params = {}) ⇒ Array<Croudia::User> Also known as: search_users_by_profile

Search for users with profile

Overloads:

  • #search_user_by_profile(q, params = {}) ⇒ Array<Croudia::User>

    Parameters:

    • q (String)

      Search query

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

      Additional query parameters

    Options Hash (params):

    • :count (String, Integer)

      Number of users in the response

    • :include_entities (String)

      Set false to exclude entities

    • :trim_user (String)

      Set true to return compact user objects

  • #search_user_by_profile(params = {}) ⇒ Array<Croudia::User>

    Parameters:

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

      Query parameters

    Options Hash (params):

    • :q (String)

      Search query

    • :count (String, Integer)

      Number of users in the response

    • :page (String, Integer)

      Page to fetch, up to 1000

    • :trim_user (String)

      Set true to return compact user objects

Returns:

See Also:



74
75
76
77
78
# File 'lib/croudia/api/search.rb', line 74

def search_user_by_profile(q, params={})
  merge_query!(params, q)
  resp = get('/profile/search.json', params)
  objects(Croudia::User, resp)
end