Class: Remit::Response
- Inherits:
-
BaseResponse
- Object
- Relax::Response
- BaseResponse
- Remit::Response
- Defined in:
- lib/remit2/response.rb
Direct Known Subclasses
CancelSubscriptionAndRefund::Response, CancelToken::Response, DiscardResults::Response, FundPrepaid::Response, GetAccountActivity::Response, GetAccountBalance::Response, GetAllCreditInstruments::Response, GetAllPrepaidInstruments::Response, GetDebtBalance::Response, GetOutstandingDebtBalance::Response, GetPaymentInstruction::Response, GetPrepaidBalance::Response, GetResults::Response, GetTokenByCaller::Response, GetTokenUsage::Response, GetTokens::Response, GetTotalPrepaidLiability::Response, GetTransaction::Response, InstallPaymentInstruction::Response, Pay::Response, Remit::Refund::Response, Remit::Reserve::Response, Remit::RetryTransaction::Response, Settle::Response, SettleDebt::Response, VerifySignature::Response, WriteOffDebt::Response
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
Class Method Summary collapse
-
.inner_parameters(*fields) ⇒ Object
Easily exposes parameters that are buried in the InnerResponse.
Instance Method Summary collapse
-
#initialize(xml) ⇒ Response
constructor
A new instance of Response.
- #node_name(name, namespace = nil) ⇒ Object
- #request_id ⇒ Object
- #successful? ⇒ Boolean
Constructor Details
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
14 15 16 |
# File 'lib/remit2/response.rb', line 14 def errors @errors end |
Class Method Details
.inner_parameters(*fields) ⇒ Object
Easily exposes parameters that are buried in the InnerResponse
48 49 50 51 52 |
# File 'lib/remit2/response.rb', line 48 def self.inner_parameters(*fields) fields.each do |inner_field_name| define_method(inner_field_name) { inner.send(inner_field_name) } end end |
Instance Method Details
#node_name(name, namespace = nil) ⇒ Object
41 42 43 44 45 |
# File 'lib/remit2/response.rb', line 41 def node_name(name, namespace=nil) super(name.to_s.split('/').collect{ |tag| tag.gsub(/(^|_)(.)/) { $2.upcase } }.join('/'), namespace) end |
#request_id ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/remit2/response.rb', line 31 def request_id # If successful it's in the ResponseMetadata, if failure, it's in the base # response. Very irritating. if successful? .request_id else elements('RequestId')[0].to_s end end |
#successful? ⇒ Boolean
27 28 29 |
# File 'lib/remit2/response.rb', line 27 def successful? @errors.empty? end |