Class: PagSeguro::PaymentReleases
- Inherits:
-
Object
- Object
- PagSeguro::PaymentReleases
- Extended by:
- Forwardable
- Includes:
- Enumerable, Extensions::EnsureType
- Defined in:
- lib/pagseguro/payment_releases.rb
Instance Method Summary collapse
-
#<<(payment) ⇒ Object
Adds payment to payment list.
-
#include?(payment) ⇒ Boolean
Verify if a payment is already included to payment list.
-
#initialize ⇒ PaymentReleases
constructor
A new instance of PaymentReleases.
Methods included from Extensions::EnsureType
Constructor Details
#initialize ⇒ PaymentReleases
Returns a new instance of PaymentReleases.
9 10 11 |
# File 'lib/pagseguro/payment_releases.rb', line 9 def initialize @payments = [] end |
Instance Method Details
#<<(payment) ⇒ Object
Adds payment to payment list.
14 15 16 17 18 |
# File 'lib/pagseguro/payment_releases.rb', line 14 def <<(payment) payment = ensure_type(PaymentRelease, payment) @payments << payment unless @payments.include? payment end |
#include?(payment) ⇒ Boolean
Verify if a payment is already included to payment list. Returns Boolean.
22 23 24 25 26 |
# File 'lib/pagseguro/payment_releases.rb', line 22 def include?(payment) self.find do |included_payment| included_payment.installment == ensure_type(PaymentRelease, payment).installment end end |