lib/pagarme/resources/recipient.rb in pagarme-2.1.3 vs lib/pagarme/resources/recipient.rb in pagarme-2.1.4

- old
+ new

@@ -2,12 +2,13 @@ class Recipient < Model def bulk_anticipations_limits(params = Hash.new) PagarMe::BulkAnticipation.bulk_anticipations_limits id, params end - def bulk_anticipations(page = 1, count = 10) - raise RequestError.new('Invalid page count') if page < 1 or count < 1 - PagarMe::BulkAnticipation.all id, page, count + def bulk_anticipations(*args, **params) + params = self.class.extract_page_count_or_params(*args, **params) + raise RequestError.new('Invalid page count') if params[:page] < 1 or params[:count] < 1 + PagarMe::BulkAnticipation.all id, params end def bulk_anticipate(params = Hash.new) PagarMe::BulkAnticipation.create params.merge(parent_id: id) end