Class: GiantBombApi::Request::Search

Inherits:
GiantBombApi::Request show all
Defined in:
lib/giant_bomb_api/request/search.rb

Instance Attribute Summary

Attributes inherited from GiantBombApi::Request

#params

Instance Method Summary collapse

Constructor Details

#initialize(query, resources: [GiantBombApi::Resource::Game], limit: 100, page: 1) ⇒ Search

Returns a new instance of Search.



4
5
6
7
8
9
10
11
12
# File 'lib/giant_bomb_api/request/search.rb', line 4

def initialize(query, resources: [GiantBombApi::Resource::Game], limit: 100, page: 1)
  params = {
    query: query,
    resources: resources.map { |res| res.resource_name }.join(','),
    limit: limit,
    page: page
  }
  super end_point, params
end

Instance Method Details

#end_pointObject



14
15
16
# File 'lib/giant_bomb_api/request/search.rb', line 14

def end_point
  '/search'
end