Class: ISO8583::MKB::ISO8583Request

Inherits:
Object
  • Object
show all
Defined in:
lib/iso8583-mkb/iso8583_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(transaction, request) ⇒ ISO8583Request

Returns a new instance of ISO8583Request.



5
6
7
8
9
10
# File 'lib/iso8583-mkb/iso8583_request.rb', line 5

def initialize(transaction, request)
  @transaction = transaction
  @request = request
  @timeout = nil
  @completion = nil
end

Instance Attribute Details

#requestObject (readonly)

Returns the value of attribute request.



3
4
5
# File 'lib/iso8583-mkb/iso8583_request.rb', line 3

def request
  @request
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



3
4
5
# File 'lib/iso8583-mkb/iso8583_request.rb', line 3

def timeout
  @timeout
end

#transactionObject (readonly)

Returns the value of attribute transaction.



3
4
5
# File 'lib/iso8583-mkb/iso8583_request.rb', line 3

def transaction
  @transaction
end

Instance Method Details

#complete(result) ⇒ Object



19
20
21
22
23
24
# File 'lib/iso8583-mkb/iso8583_request.rb', line 19

def complete(result)
  block = @completion
  @completion = nil

  block.call result
end

#start(timeout = nil, &completion) ⇒ Object



12
13
14
15
16
17
# File 'lib/iso8583-mkb/iso8583_request.rb', line 12

def start(timeout = nil, &completion)
  @completion = completion
  @timeout = timeout

  @transaction.gateway.post_request self
end