Class: Netvisor::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/netvisor/base.rb

Instance Method Summary collapse

Instance Method Details

#request(data_object, service, method = nil, id = nil) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/netvisor/base.rb', line 10

def request(data_object, service, method = nil, id = nil)
  root = Root.new
  root.send("#{service}=", data_object)
  # validate root
  req = Request.new

  req.dispatch(root.to_xml, service, method, id)
end

#send_invoice(sales_invoice) ⇒ Object



6
7
8
# File 'lib/netvisor/base.rb', line 6

def send_invoice(sales_invoice)
  request(sales_invoice, 'sales_invoice')
end