Module: SynsbasenApi::Searchable

Included in:
Brand, ErrorCode, Inspection, LeasingPeriod, Model, Variant, Vehicle, Version
Defined in:
lib/synsbasen_api/searchable.rb

Overview

Provides a search method for resources.

This module is intended to be extended in classes that represent resources.

Instance Method Summary collapse

Instance Method Details

#search(args = {}, expand: nil) ⇒ ApiResponse

Performs a search for resources based on the provided criteria.

Parameters:

  • args (Hash) (defaults to: {})

    Additional parameters to customize the search.

Options Hash (args):

  • :method (String)

    The search method. Default is 'SELECT'.

Returns:

  • (ApiResponse)

    An instance of ApiResponse containing search results.



13
14
15
16
17
18
19
20
21
# File 'lib/synsbasen_api/searchable.rb', line 13

def search(args = {}, expand: nil)
  post(
    "/v1/#{resource_name}/search",
    body: {
      method: 'SELECT',
    }.merge(args),
    expand: expand
  )
end