Class: UCLAPI::Client::Search

Inherits:
Object
  • Object
show all
Defined in:
lib/uclapi/client/search.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Search

Returns a new instance of Search.



2
3
4
# File 'lib/uclapi/client/search.rb', line 2

def initialize client
  @client = client
end

Instance Method Details

#people(params = {}) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/uclapi/client/search.rb', line 6

def people(params = {})
  params['query'] || params[:query] || raise(KeyError, "Missing required argument: query")

  @client.get('/search/people', params)['people'].map do |people|
    people[:client] = @client
    UCLAPI::People.new(people)
  end
end