Class: PagarMe::Recipient
- Inherits:
-
Model
show all
- Defined in:
- lib/pagarme/resources/recipient.rb
Constant Summary
PagarMeObject::RESOURCES
Instance Attribute Summary
#attributes
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Model
all, class_name, #create, create, extract_page_count_or_params, find_by, find_by_id, #save, underscored_class_name, url, #url
#==, #[]=, convert, #empty?, #initialize, #respond_to?, #to_hash, #to_s, #unsaved_attributes
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class PagarMe::PagarMeObject
Class Method Details
29
30
31
|
# File 'lib/pagarme/resources/recipient.rb', line 29
def self.default
Company.default_recipient
end
|
Instance Method Details
#balance_operations(*args) ⇒ Object
#bulk_anticipate(params = Hash.new) ⇒ Object
13
14
15
|
# File 'lib/pagarme/resources/recipient.rb', line 13
def bulk_anticipate(params = Hash.new)
PagarMe::BulkAnticipation.create params.merge(parent_id: id)
end
|
#bulk_anticipations(*args, **params) ⇒ Object
7
8
9
10
11
|
# File 'lib/pagarme/resources/recipient.rb', line 7
def bulk_anticipations(*args, **params)
params = self.class.(*args, **params)
raise RequestError.new('Invalid page count') if params[:page] < 1 or params[:count] < 1
PagarMe::BulkAnticipation.all id, params
end
|
#bulk_anticipations_limits(params = Hash.new) ⇒ Object
#receive(amount) ⇒ Object
25
26
27
|
# File 'lib/pagarme/resources/recipient.rb', line 25
def receive(amount)
PagarMe::Transfer.create recipient_id: id, amount: amount
end
|