Class: Allegro::WebApi::Search

Inherits:
Object
  • Object
show all
Defined in:
lib/allegro/webapi/search.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Search

Returns a new instance of Search.



6
7
8
# File 'lib/allegro/webapi/search.rb', line 6

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



4
5
6
# File 'lib/allegro/webapi/search.rb', line 4

def client
  @client
end

Instance Method Details

#search_query(search_string, options = {}) ⇒ Object



11
12
13
14
# File 'lib/allegro/webapi/search.rb', line 11

def search_query(search_string, options = {})
  message = {session_handle: client.session_handle, search_query: {search_string: search_string}.merge(options)}
  client.call(:do_search, message: message).body
end