Class: NWRFC::Transaction
- Inherits:
-
Object
- Object
- NWRFC::Transaction
- Defined in:
- lib/nwrfc.rb
Instance Attribute Summary collapse
-
#handle ⇒ Object
readonly
Returns the value of attribute handle.
Instance Method Summary collapse
- #commit ⇒ Object (also: #submit)
-
#initialize(handle) ⇒ Transaction
constructor
A new instance of Transaction.
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
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
127 128 129 |
# File 'lib/nwrfc.rb', line 127 def handle @handle end |
Instance Method Details
#commit ⇒ Object 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 |