Class: Cornerstore::PaymentMeans
- Inherits:
-
Model::Base
- Object
- Model::Base
- Cornerstore::PaymentMeans
- Defined in:
- lib/cornerstore/api/payment_means.rb
Instance Attribute Summary collapse
-
#bank ⇒ Object
Returns the value of attribute bank.
-
#card_token ⇒ Object
Returns the value of attribute card_token.
-
#iban ⇒ Object
Returns the value of attribute iban.
-
#issuer ⇒ Object
Returns the value of attribute issuer.
-
#kind ⇒ Object
(also: #type)
Returns the value of attribute kind.
-
#last_digits ⇒ Object
Returns the value of attribute last_digits.
-
#owner ⇒ Object
Returns the value of attribute owner.
-
#paid_at ⇒ Object
Returns the value of attribute paid_at.
-
#payment_id ⇒ Object
Returns the value of attribute payment_id.
-
#refunded_at ⇒ Object
Returns the value of attribute refunded_at.
-
#swift_bic ⇒ Object
Returns the value of attribute swift_bic.
Attributes inherited from Model::Base
#_id, #_slugs, #created_at, #parent, #updated_at
Instance Method Summary collapse
-
#initialize(attributes = {}, parent = nil) ⇒ PaymentMeans
constructor
A new instance of PaymentMeans.
- #paid? ⇒ Boolean
- #refunded? ⇒ Boolean
Methods inherited from Model::Base
#==, #attributes, #attributes=, #inspect, #method_missing, method_missing, #to_param, #url
Constructor Details
#initialize(attributes = {}, parent = nil) ⇒ PaymentMeans
Returns a new instance of PaymentMeans.
16 17 18 19 20 21 22 23 |
# File 'lib/cornerstore/api/payment_means.rb', line 16 def initialize(attributes = {}, parent = nil) if attributes self.paid_at = DateTime.parse(attributes.delete('paid_at')) unless attributes['paid_at'].blank? self.refunded_at = DateTime.parse(attributes.delete('refunded_at')) unless attributes['refunded_at'].blank? end super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Cornerstore::Model::Base
Instance Attribute Details
#bank ⇒ Object
Returns the value of attribute bank.
2 3 4 |
# File 'lib/cornerstore/api/payment_means.rb', line 2 def bank @bank end |
#card_token ⇒ Object
Returns the value of attribute card_token.
2 3 4 |
# File 'lib/cornerstore/api/payment_means.rb', line 2 def card_token @card_token end |
#iban ⇒ Object
Returns the value of attribute iban.
2 3 4 |
# File 'lib/cornerstore/api/payment_means.rb', line 2 def iban @iban end |
#issuer ⇒ Object
Returns the value of attribute issuer.
2 3 4 |
# File 'lib/cornerstore/api/payment_means.rb', line 2 def issuer @issuer end |
#kind ⇒ Object Also known as: type
Returns the value of attribute kind.
2 3 4 |
# File 'lib/cornerstore/api/payment_means.rb', line 2 def kind @kind end |
#last_digits ⇒ Object
Returns the value of attribute last_digits.
2 3 4 |
# File 'lib/cornerstore/api/payment_means.rb', line 2 def last_digits @last_digits end |
#owner ⇒ Object
Returns the value of attribute owner.
2 3 4 |
# File 'lib/cornerstore/api/payment_means.rb', line 2 def owner @owner end |
#paid_at ⇒ Object
Returns the value of attribute paid_at.
2 3 4 |
# File 'lib/cornerstore/api/payment_means.rb', line 2 def paid_at @paid_at end |
#payment_id ⇒ Object
Returns the value of attribute payment_id.
2 3 4 |
# File 'lib/cornerstore/api/payment_means.rb', line 2 def payment_id @payment_id end |
#refunded_at ⇒ Object
Returns the value of attribute refunded_at.
2 3 4 |
# File 'lib/cornerstore/api/payment_means.rb', line 2 def refunded_at @refunded_at end |
#swift_bic ⇒ Object
Returns the value of attribute swift_bic.
2 3 4 |
# File 'lib/cornerstore/api/payment_means.rb', line 2 def swift_bic @swift_bic end |
Instance Method Details
#paid? ⇒ Boolean
25 26 27 |
# File 'lib/cornerstore/api/payment_means.rb', line 25 def paid? self.paid_at.is_a?(DateTime) end |
#refunded? ⇒ Boolean
29 30 31 |
# File 'lib/cornerstore/api/payment_means.rb', line 29 def refunded? self.refunded_at.is_a?(DateTime) end |