Class: PaystackSubaccounts

Inherits:
PaystackBaseObject show all
Defined in:
lib/paystack/objects/subaccounts.rb

Instance Attribute Summary

Attributes inherited from PaystackBaseObject

#paystack

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PaystackBaseObject

#initialize

Constructor Details

This class inherits a constructor from PaystackBaseObject

Class Method Details

.create(paystackObj, data) ⇒ Object



22
23
24
# File 'lib/paystack/objects/subaccounts.rb', line 22

def PaystackSubaccounts.create(paystackObj, data)
	initPostRequest(paystackObj,"#{API::SUBACCOUNT_PATH}",  data)
end

.get(paystackObj, subaccount_id) ⇒ Object



30
31
32
# File 'lib/paystack/objects/subaccounts.rb', line 30

def PaystackSubaccounts.get(paystackObj, subaccount_id)
	initGetRequest(paystackObj, "#{API::SUBACCOUNT_PATH}/#{subaccount_id}")
end

.list(paystackObj, page = 1) ⇒ Object



34
35
36
# File 'lib/paystack/objects/subaccounts.rb', line 34

def PaystackSubaccounts.list(paystackObj, page=1)
	initGetRequest(paystackObj, "#{API::SUBACCOUNT_PATH}?page=#{page}")
end

.update(paystackObj, subaccount_id, data) ⇒ Object



26
27
28
# File 'lib/paystack/objects/subaccounts.rb', line 26

def PaystackSubaccounts.update(paystackObj, subaccount_id, data)
	initPutRequest(paystackObj,"#{API::SUBACCOUNT_PATH}/#{subaccount_id}",  data)
end

Instance Method Details

#create(data = {}) ⇒ Object



4
5
6
# File 'lib/paystack/objects/subaccounts.rb', line 4

def create(data={})
	return PaystackSubaccounts.create(@paystack, data)
end

#get(subaccount_id) ⇒ Object



8
9
10
# File 'lib/paystack/objects/subaccounts.rb', line 8

def get(subaccount_id)
	return PaystackSubaccounts.get(@paystack, subaccount_id)
end

#list(page = 1) ⇒ Object



17
18
19
# File 'lib/paystack/objects/subaccounts.rb', line 17

def list(page=1)
	return PaystackSubaccounts.list(@paystack, page)
end

#update(subaccount_id, data = {}) ⇒ Object



13
14
15
# File 'lib/paystack/objects/subaccounts.rb', line 13

def update(subaccount_id, data={})
	return PaystackSubaccounts.update(@paystack, subaccount_id,  data)
end