Class: NWRFC::Transaction

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(handle) ⇒ Transaction

Returns a new instance of Transaction.



129
130
131
132
# File 'lib/nwrfc.rb', line 129

def initialize(handle)
  @handle = handle
  @error =  NWRFCLib::RFCError.new
end

Instance Attribute Details

#handleObject (readonly)

Returns the value of attribute handle.



127
128
129
# File 'lib/nwrfc.rb', line 127

def handle
  @handle
end

Instance Method Details

#commitObject Also known as: submit



134
135
136
137
138
139
140
141
# File 'lib/nwrfc.rb', line 134

def commit
  rc = NWRFCLib.submit_transaction(@handle, @error)
  NWRFC.check_error(@error) if rc > 0
  rc = NWRFCLib.confirm_transaction(@handle, @error)
  NWRFC.check_error(@error) if rc > 0
  rc = NWRFCLib.destroy_transaction(@handle, @error)
  NWRFC.check_error(@error) if rc > 0
end