Module: AdaptivePayments::FaultMessage

Included in:
AbstractResponse
Defined in:
lib/pp-adaptive/types/fault_message.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/pp-adaptive/types/fault_message.rb', line 3

def self.included(base)
  base.instance_eval do
    attribute :errors, NodeList[ErrorData], :param => "error"

    alias_params :first_error, {
      :error_id         => :id,
      :error_domain     => :domain,
      :error_subdomain  => :subdomain,
      :error_severity   => :severity,
      :error_category   => :category,
      :error_message    => :message,
      :error_parameters => :parameters
    }
  end
end

Instance Method Details

#first_errorObject



19
20
21
# File 'lib/pp-adaptive/types/fault_message.rb', line 19

def first_error
  errors.first || ErrorData.new
end