Class: Zooz::Request::Verify
- Inherits:
-
Object
- Object
- Zooz::Request::Verify
- Defined in:
- lib/zooz/request/verify.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#trx_id ⇒ Object
Returns the value of attribute trx_id.
Instance Method Summary collapse
-
#initialize ⇒ Verify
constructor
A new instance of Verify.
- #request ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
9 10 11 |
# File 'lib/zooz/request/verify.rb', line 9 def errors @errors end |
#trx_id ⇒ Object
Returns the value of attribute trx_id.
8 9 10 |
# File 'lib/zooz/request/verify.rb', line 8 def trx_id @trx_id end |
Instance Method Details
#request ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/zooz/request/verify.rb', line 20 def request return false unless valid? @requestor.set_param('trxId', @trx_id) verify_response = Response::Verify.new verify_response.request = self verify_response.response = @requestor.request unless verify_response.response @errors += @requestor.errors return false end verify_response end |
#valid? ⇒ Boolean
33 34 35 36 37 38 |
# File 'lib/zooz/request/verify.rb', line 33 def valid? @errors = [] @errors << 'trx_id is required' if @trx_id.nil? @errors += @requestor.errors unless @requestor.valid? @errors.empty? end |