Module: QBWC

Included in:
DefaultMappingRegistry, SoapWrapper
Defined in:
lib/qbwc.rb,
lib/qbwc/version.rb,
lib/generators/qbwc/install/install_generator.rb

Defined Under Namespace

Modules: DefaultMappingRegistry, Generators Classes: Authenticate, AuthenticateResponse, ClientVersion, ClientVersionResponse, CloseConnection, CloseConnectionResponse, ConnectionError, ConnectionErrorResponse, GetLastError, GetLastErrorResponse, Job, QBWebConnectorSvcSoap, ReceiveResponseXML, ReceiveResponseXMLResponse, Request, SendRequestXML, SendRequestXMLResponse, ServerVersion, ServerVersionResponse, Session, SoapWrapper

Constant Summary collapse

VERSION =
"0.0.4"
@@username =
'foo'
@@password =
'bar'
@@company_file_path =
""
@@min_version =
3.0
@@support_site_url =
'http://google.com'
@@owner_id =
'{57F3B9B1-86F1-4fcc-B1EE-566DE1813D20}'
@@jobs =
{}
@@on_error =
'stopOnError'
@@delayed_processing =
false
@@api =
:qb
@@warm_boot =
true

Class Method Summary collapse

Class Method Details

.add_job(name, &block) ⇒ Object



51
52
53
# File 'lib/qbwc.rb', line 51

def add_job(name, &block)
  @@jobs[name] = Job.new(name, &block)
end

.api=(api) ⇒ Object



61
62
63
64
65
66
67
68
69
70
71
# File 'lib/qbwc.rb', line 61

def api=(api)
  raise 'Quickbooks type must be :qb or :qbpos' unless [:qb, :qbpos].include?(api)
  @@api = api
  if @@warm_boot
    ::Rails.logger.warn "using warm boot"
    @@parser = ::Rails.cache.read("qb_api_#{api}") || ::Quickbooks::API[api] 
    ::Rails.cache.write("qb_api_#{api}", @@parser)
  else
    @@parser = ::Quickbooks::API[api] 
  end
end

.configure {|_self| ... } ⇒ Object

Allow configuration overrides

Yields:

  • (_self)

Yield Parameters:

  • _self (QBWC)

    the object that the method was called on



74
75
76
# File 'lib/qbwc.rb', line 74

def configure
  yield self
end

.on_error=(reaction) ⇒ Object



55
56
57
58
59
# File 'lib/qbwc.rb', line 55

def on_error=(reaction)
  raise 'Quickbooks type must be :qb or :qbpos' unless [:stop, :continue].include?(reaction)
  @@on_error = "stopOnError" if reaction == :stop
  @@on_error = "continueOnError" if reaction == :continue
end