Class: SellsyV2::Search
- Inherits:
-
Object
- Object
- SellsyV2::Search
- Defined in:
- lib/sellsy_v2.rb
Constant Summary collapse
- ROOT_PATH =
'/search'
Instance Method Summary collapse
-
#initialize(query:, **options) ⇒ Search
constructor
A new instance of Search.
Constructor Details
#initialize(query:, **options) ⇒ Search
Returns a new instance of Search.
40 41 42 43 44 45 |
# File 'lib/sellsy_v2.rb', line 40 def initialize(query:, **) search_response = Request.new(path: ROOT_PATH, verb: 'get', options: .merge({q: query})).call if search_response.success? search_response.data.dig('data').map{OpenStruct.new(_1)} end end |