Sha256: 914c41ecb7bffc36abbb5aeae6b69a753355083589fa1b686e69da8ce05b034b

Contents?: true

Size: 610 Bytes

Versions: 25

Compression:

Stored size: 610 Bytes

Contents

module Braintree
  # See http://www.braintreepayments.com/docs/ruby/general/result_objects
  class SuccessfulResult
    include BaseModule

    def initialize(attributes = {}) # :nodoc:
      @attrs = attributes.keys
      singleton_class.class_eval do
        attributes.each do |key, value|
          define_method key do
            value
          end
        end
      end
    end

    def inspect # :nodoc:
      inspected_attributes = @attrs.map { |attr| "#{attr}:#{send(attr).inspect}" }
      "#<#{self.class} #{inspected_attributes.join(" ")}>"
    end

    def success?
      true
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
braintree-2.30.0 lib/braintree/successful_result.rb
braintree-2.29.0 lib/braintree/successful_result.rb
braintree-2.28.0 lib/braintree/successful_result.rb
braintree-2.27.1 lib/braintree/successful_result.rb
braintree-2.27.0 lib/braintree/successful_result.rb
braintree-2.26.0 lib/braintree/successful_result.rb
braintree-2.25.0 lib/braintree/successful_result.rb
braintree-2.24.0 lib/braintree/successful_result.rb
braintree-2.23.0 lib/braintree/successful_result.rb
braintree-2.22.0 lib/braintree/successful_result.rb
braintree-2.21.0 lib/braintree/successful_result.rb
braintree-2.20.0 lib/braintree/successful_result.rb
braintree-2.19.0 lib/braintree/successful_result.rb
braintree-2.18.0 lib/braintree/successful_result.rb
braintree-2.17.0 lib/braintree/successful_result.rb
braintree-2.16.0 lib/braintree/successful_result.rb
braintree-2.15.0 lib/braintree/successful_result.rb
braintree-2.14.0 lib/braintree/successful_result.rb
braintree-2.13.4 lib/braintree/successful_result.rb
braintree-2.13.3 lib/braintree/successful_result.rb