Class: Squall::Transaction

Inherits:
Base
  • Object
show all
Defined in:
lib/squall/transaction.rb

Overview

OnApp Transaction

Instance Attribute Summary

Attributes inherited from Base

#result, #success

Instance Method Summary (collapse)

Methods inherited from Base

#check_config, #default_params, #key_for_class, #request

Instance Method Details

- (Object) list

Lists all transactions.

Returns:

  • an Array.



7
8
9
10
# File 'lib/squall/transaction.rb', line 7

def list
  response = request :get, '/transactions.json'
  response.collect { |t| t['transaction'] }
end

- (Object) show(id)

Get info for the given transaction.

Parameters:

  • id

    ID of transaction

Returns:

  • a Hash.



17
18
19
20
# File 'lib/squall/transaction.rb', line 17

def show(id)
  response = request :get, "/transactions/#{id}.json"
  response['transaction']
end