Class: SageWorld::Api::Supplier

Inherits:
Base
  • Object
show all
Defined in:
lib/sage_world/api/supplier.rb

Instance Method Summary collapse

Constructor Details

#initialize(supplier_id) ⇒ Supplier



5
6
7
# File 'lib/sage_world/api/supplier.rb', line 5

def initialize(supplier_id)
  @supplier_id = supplier_id
end

Instance Method Details

#details(options = {}) ⇒ Object

ExtraReturnFields => specifies additional fields to be returned. If you would like to return the general information for a supplier,

                     then include GENINFO in this field. Otherwise leave it blank.
supplier = SageWorld::Api::Supplier.new("22")
e.g response = supplier.details({ extra_return_fields: "geninfo" })


22
23
24
25
26
27
28
29
30
# File 'lib/sage_world/api/supplier.rb', line 22

def details(options = {})
  if @existing_options == options
    @response
  else
    @existing_options = options
    response = SageWorld::Client.new(find_supplier_params(@supplier_id, options)).send_request
    @response = SageWorld::ResponseHandler.new(response)
  end
end