Class: Braintree::SuccessfulResult
- Inherits:
-
Object
- Object
- Braintree::SuccessfulResult
- Includes:
- BaseModule
- Defined in:
- lib/braintree/successful_result.rb
Overview
Instance Method Summary (collapse)
-
- (SuccessfulResult) initialize(attributes = {})
constructor
:nodoc:.
-
- (Object) inspect
:nodoc:.
-
- (Boolean) success?
Always returns true.
Methods included from BaseModule
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?
Always returns true.
23 24 25 |
# File 'lib/braintree/successful_result.rb', line 23 def success? true end |