Class: PagarMe::BulkAnticipation

Inherits:
NestedModel show all
Defined in:
lib/pagarme/resources/bulk_anticipation.rb

Constant Summary

Constants inherited from PagarMeObject

PagarMeObject::RESOURCES

Instance Attribute Summary

Attributes inherited from NestedModel

#parent_id

Attributes inherited from PagarMeObject

#attributes

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from NestedModel

all, #create, find_by, find_by_id, #initialize, #url, url

Methods inherited from Model

all, class_name, #create, extract_page_count_or_params, find_by, find_by_id, #save, underscored_class_name, url, #url

Methods inherited from PagarMeObject

#==, #[]=, convert, #empty?, #initialize, #respond_to?, #to_hash, #to_s, #unsaved_attributes

Constructor Details

This class inherits a constructor from PagarMe::NestedModel

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PagarMe::PagarMeObject

Class Method Details

.bulk_anticipations_limits(recipient_id, params = Hash.new) ⇒ Object



38
39
40
# File 'lib/pagarme/resources/bulk_anticipation.rb', line 38

def bulk_anticipations_limits(recipient_id, params = Hash.new)
  PagarMe::Request.get(url(recipient_id, 'limits'), params: normalize_params(params) ).call
end

.cancel(recipient_id, id) ⇒ Object



30
31
32
# File 'lib/pagarme/resources/bulk_anticipation.rb', line 30

def cancel(recipient_id, id)
  PagarMe::Request.post( url(recipient_id, id, 'cancel') ).call
end

.confirm(recipient_id, id) ⇒ Object



22
23
24
# File 'lib/pagarme/resources/bulk_anticipation.rb', line 22

def confirm(recipient_id, id)
  PagarMe::Request.post( url(recipient_id, id, 'confirm') ).call
end

.create(params = Hash.new) ⇒ Object



34
35
36
# File 'lib/pagarme/resources/bulk_anticipation.rb', line 34

def create(params = Hash.new)
  super normalize_params(params)
end

.delete(recipient_id, id) ⇒ Object



26
27
28
# File 'lib/pagarme/resources/bulk_anticipation.rb', line 26

def delete(recipient_id, id)
  PagarMe::Request.delete( url(recipient_id, id) ).call
end

.parent_resource_nameObject



18
19
20
# File 'lib/pagarme/resources/bulk_anticipation.rb', line 18

def parent_resource_name
  'recipients'
end

Instance Method Details

#cancelObject



12
13
14
15
# File 'lib/pagarme/resources/bulk_anticipation.rb', line 12

def cancel
  update self.class.cancel(parent_id, id).attributes
  self
end

#confirmObject



3
4
5
6
# File 'lib/pagarme/resources/bulk_anticipation.rb', line 3

def confirm
  update self.class.confirm(parent_id, id).attributes
  self
end

#deleteObject



8
9
10
# File 'lib/pagarme/resources/bulk_anticipation.rb', line 8

def delete
  self.class.delete parent_id, id
end