Class: Paymongo::SuccessfulResult

Inherits:
Object
  • Object
show all
Defined in:
lib/paymongo/successful_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#transactionObject (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

#inspectObject



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

Returns:

  • (Boolean)


16
17
18
# File 'lib/paymongo/successful_result.rb', line 16

def success?
  true
end