class Braintree::Errors

Public Class Methods

new(data = {}) click to toggle source
# File lib/braintree/errors.rb, line 5
def initialize(data = {})
  @errors = ValidationErrorCollection.new(data.merge(:errors => []))
end

Public Instance Methods

_inner_inspect() click to toggle source
# File lib/braintree/errors.rb, line 28
def _inner_inspect
  @errors._inner_inspect
end
each(&block) click to toggle source
# File lib/braintree/errors.rb, line 9
def each(&block)
  @errors.deep_errors.each(&block)
end
for(scope) click to toggle source
# File lib/braintree/errors.rb, line 13
def for(scope)
  @errors.for(scope)
end
inspect() click to toggle source
# File lib/braintree/errors.rb, line 17
def inspect
  "#<#{self.class} #{_inner_inspect}>"
end
size() click to toggle source

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.

# File lib/braintree/errors.rb, line 24
def size
  @errors.deep_size
end