Class: Laximo::Am

Inherits:
Object
  • Object
show all
Defined in:
lib/laximo/am.rb

Constant Summary collapse

DEFAULT_OPTIONS =
[
  :crosses,
  :properties,
  :names,
  :weights,
  :prices,
  :images
].freeze

Instance Method Summary collapse

Constructor Details

#initializeAm

Returns a new instance of Am.



15
16
17
18
19
20
21
22
# File 'lib/laximo/am.rb', line 15

def initialize

  @request = ::Laximo::Request.new(
    ::Laximo.options.am_soap_endpoint,
    ::Laximo.options.am_soap_action
  )

end

Instance Method Details

#find_detail(detail_id, options: DEFAULT_OPTIONS, locale: ::Laximo.options.locale) ⇒ Object

find_replacements



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/laximo/am.rb', line 58

def find_detail(
  detail_id,
  options:  DEFAULT_OPTIONS,
  locale:   ::Laximo.options.locale
)

  resp = ::Laximo::Query.
    new('FindDetail').
    locale(locale).
    detail_id(detail_id).
    options(options).
    call(@request)

  ::Laximo::Respond::FindDetail.new(resp)

end

#find_oem(oem, brand: nil, options: DEFAULT_OPTIONS, locale: ::Laximo.options.locale) ⇒ Object

initialize



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/laximo/am.rb', line 24

def find_oem(
  oem,
  brand:    nil,
  options:  DEFAULT_OPTIONS,
  locale:   ::Laximo.options.locale
)

  resp = ::Laximo::Query.
    new('FindOEM').
    locale(locale).
    brand(brand).
    oem(oem).
    options(options).
    call(@request)

  ::Laximo::Respond::FindOem.new(resp)

end

#find_oem_correction(oem, brand: nil, locale: ::Laximo.options.locale) ⇒ Object

find_detail



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/laximo/am.rb', line 75

def find_oem_correction(
  oem,
  brand:    nil,
  locale:   ::Laximo.options.locale
)

  resp = ::Laximo::Query.
    new('FindOEMCorrection').
    locale(locale).
    brand(brand).
    oem(oem).
    call(@request)

  ::Laximo::Respond::FindOemCorrection.new(resp)

end

#find_replacements(detail_id, locale: ::Laximo.options.locale) ⇒ Object

find_oem



43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/laximo/am.rb', line 43

def find_replacements(
  detail_id,
  locale: ::Laximo.options.locale
)

  resp = ::Laximo::Query.
    new('FindReplacements').
    locale(locale).
    detail_id(detail_id).
    call(@request)

  ::Laximo::Respond::FindReplacements.new(resp)

end

#list_manufacturer(locale: ::Laximo.options.locale) ⇒ Object

manufacturer_info



107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/laximo/am.rb', line 107

def list_manufacturer(
  locale: ::Laximo.options.locale
)

  resp = ::Laximo::Query.
    new('ListManufacturer').
    locale(locale).
    call(@request)

  ::Laximo::Respond::ListManufacturer.new(resp)

end

#manufacturer_info(manufacturer_id, locale: ::Laximo.options.locale) ⇒ Object

find_oem_correction



92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/laximo/am.rb', line 92

def manufacturer_info(
  manufacturer_id,
  locale: ::Laximo.options.locale
)

  resp = ::Laximo::Query.
    new('ManufacturerInfo').
    locale(locale).
    manufacturer_id(manufacturer_id).
    call(@request)

  ::Laximo::Respond::Manufacturer_Info.new(resp)

end