Class: Braintree::SuccessfulResult

Inherits:
Object
  • Object
show all
Includes:
BaseModule
Defined in:
lib/braintree/successful_result.rb

Overview

Instance Method Summary (collapse)

Methods included from BaseModule

included

Methods included from BaseModule::Methods

#copy_instance_variables_from_object, #return_object_or_raise, #set_instance_variables_from_hash, #singleton_class

Constructor Details

- (SuccessfulResult) initialize(attributes = {})

:nodoc:



6
7
8
9
10
11
12
13
14
15
# File 'lib/braintree/successful_result.rb', line 6

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

Instance Method Details

- (Object) inspect

:nodoc:



17
18
19
20
# File 'lib/braintree/successful_result.rb', line 17

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

- (Boolean) success?



22
23
24
# File 'lib/braintree/successful_result.rb', line 22

def success?
  true
end