Class: Paymongo::SuccessfulResult
- Inherits:
-
Object
- Object
- Paymongo::SuccessfulResult
- Defined in:
- lib/paymongo/successful_result.rb
Instance Attribute Summary collapse
-
#transaction ⇒ Object
readonly
Returns the value of attribute transaction.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ SuccessfulResult
constructor
A new instance of SuccessfulResult.
- #inspect ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(attributes = {}) ⇒ SuccessfulResult
Returns a new instance of SuccessfulResult.
5 6 7 8 |
# File 'lib/paymongo/successful_result.rb', line 5 def initialize(attributes = {}) @attrs = attributes.keys attributes.each { |key, value| instance_variable_set("@#{key}", value) } end |
Instance Attribute Details
#transaction ⇒ Object (readonly)
Returns the value of attribute transaction.
3 4 5 |
# File 'lib/paymongo/successful_result.rb', line 3 def transaction @transaction end |
Instance Method Details
#inspect ⇒ Object
10 11 12 13 14 |
# File 'lib/paymongo/successful_result.rb', line 10 def inspect inspected_attributes = @attrs.map { |attr| "#{attr}:#{send(attr).inspect}" } "#<#{self.class} #{inspected_attributes.join(' ')}>" end |
#success? ⇒ Boolean
16 17 18 |
# File 'lib/paymongo/successful_result.rb', line 16 def success? true end |