Module: NexusLink::NAX

Defined in:
lib/nexus_link/nax.rb,
lib/nexus_link/nax/enlace.rb,
lib/nexus_link/nax/pedido_venta.rb

Defined Under Namespace

Classes: Enlace, PedidoVenta

Class Method Summary collapse

Class Method Details

.checkObject



11
12
13
# File 'lib/nexus_link/nax.rb', line 11

def self.check
  @enlace.check
end

.closeObject



36
37
38
39
40
41
# File 'lib/nexus_link/nax.rb', line 36

def self.close
  return if closed?
  nax = enlace
  enlace = nil
  nax.close
end

.closed?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/nexus_link/nax.rb', line 27

def self.closed?
  !open?
end

.create_enlaceObject



49
50
51
52
53
54
55
56
# File 'lib/nexus_link/nax.rb', line 49

def self.create_enlace
  nax_enl = NexusLink::NAX::Enlace.new
  nax_enl.RaiseOnException = false
  nax_enl.LoginUsuario(@conn['username'], @conn['password'])
  nax_enl.Iniciar(@conn['nax_empresa'])
  nax_enl.check
  nax_enl
end

.enlaceObject



15
16
17
# File 'lib/nexus_link/nax.rb', line 15

def self.enlace
  @enlace ||= open
end

.enlace=(value) ⇒ Object



19
20
21
# File 'lib/nexus_link/nax.rb', line 19

def self.enlace=(value)
  @enlace = value
end

.establish_connection(conn) ⇒ Object



43
44
45
46
47
# File 'lib/nexus_link/nax.rb', line 43

def self.establish_connection(conn)
  @conn = conn.dup
  @conn['nax_empresa'] ||= @conn['database']
  self
end

.openObject



31
32
33
34
# File 'lib/nexus_link/nax.rb', line 31

def self.open
  return if open?
  @enlace = create_enlace
end

.open?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/nexus_link/nax.rb', line 23

def self.open?
  @enlace
end