Method: TecDoc::Article.search

Defined in:
lib/tec_doc/article.rb

.search(options = {}) ⇒ Array<TecDoc::Article>

Find article by all number types and brand number and generic article id.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :article_number (String)

    Article number will be converted within the search process to a simplified article number

  • :brand_no (Integer)

    result of brand selection (optional)

  • :country (String)

    country code according to ISO 3166

  • :generic_article_id (Integer)

    result of generic article selection (optional)

  • :lang (String)

    language code according to ISO 639

  • :number_type (String)

    Number type (0: Article number, 1: OE number, 2: Trade number, 3: Comparable number, 4: Replacement number, 5: Replaced number, 6: EAN number, 10: Any number)

  • :search_exact (TrueClass, FalseClass)

    Search mode (true: exact search, false: similar search)

  • :sort_type (Integer)

    Sort mode (1: Brand, 2: Product group)

Returns:



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/tec_doc/article.rb', line 19

def self.search(options = {})
  options = {
    :country => TecDoc.client.country,
    :lang => I18n.locale.to_s,
    :number_type => 10,
    :search_exact => 1,
    :sort_type => 1
  }.merge(options)
  TecDoc.client.request(:get_article_direct_search_all_numbers2, options).map do |attributes|
    new(attributes, options)
  end
end