class Braintree::Errors
Public Class Methods
Source
# File lib/braintree/errors.rb, line 5 def initialize(data = {}) data = data.merge(:errors => []) unless data @errors = ValidationErrorCollection.new(data) end
Public Instance Methods
Source
# File lib/braintree/errors.rb, line 29 def _inner_inspect @errors._inner_inspect end
Source
# File lib/braintree/errors.rb, line 10 def each(&block) @errors.deep_errors.each(&block) end
Source
# File lib/braintree/errors.rb, line 18 def inspect "#<#{self.class} #{_inner_inspect}>" end
Source
# File lib/braintree/errors.rb, line 25 def size @errors.deep_size end
Returns the total number of validation errors at all levels of nesting. For example, if creating a customer with a credit card and a billing address, and each of the customer, credit card, and billing address has 1 error, this method will return 3.