Class: Interpark::Book::Search
- Inherits:
-
Requirement
- Object
- Requirement
- Interpark::Book::Search
- Defined in:
- lib/interpark/book/search.rb
Class Method Summary collapse
-
.query(content, options = {}) ⇒ Object
soldOut y(기본값) : 품절/절판함께보기 n : 품절/절판빼고보기.
Methods inherited from Requirement
Class Method Details
.query(content, options = {}) ⇒ Object
soldOut y(기본값) : 품절/절판함께보기n : 품절/절판빼고보기
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/interpark/book/search.rb', line 56 def query(content, = {}) query_type = [:query_type].nil? ? "title" : [:query_type] search_target = [:search_target].nil? ? "book" : [:search_target] start = [:start].nil? ? 1 : [:start] max_results = [:max_results].nil? ? 10 : [:max_results] sort = [:sort].nil? ? "accuracy" : [:sort] category_id = [:category_id].nil? ? 100 : [:category_id] output = [:output].nil? ? "xml" : [:output] input_encoding = [:input_encoding].nil? ? "utf-8" : [:input_encoding] adult_image_exposure = [:adult_image_exposure].nil? ? "n" : [:adult_image_exposure] sold_out = [:sold_out].nil? ? "y" : [:sold_out] res = client.search(content, { "queryType" => query_type, "searchTarget" => search_target, "start" => start, "maxResults" => max_results, "sort" => sort, "categoryId" => category_id, # "output" => output, "output" => "json", "inputEncoding" => input_encoding, "adultImageExposure" => adult_image_exposure, "soldOut" => sold_out, }) end |