Class: Cornerstore::PaymentMeans

Inherits:
Model::Base show all
Defined in:
lib/cornerstore/api/payment_means.rb

Instance Attribute Summary collapse

Attributes inherited from Model::Base

#_id, #_slugs, #created_at, #parent, #updated_at

Instance Method Summary collapse

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

#bankObject

Returns the value of attribute bank.



2
3
4
# File 'lib/cornerstore/api/payment_means.rb', line 2

def bank
  @bank
end

#card_tokenObject

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

#ibanObject

Returns the value of attribute iban.



2
3
4
# File 'lib/cornerstore/api/payment_means.rb', line 2

def iban
  @iban
end

#issuerObject

Returns the value of attribute issuer.



2
3
4
# File 'lib/cornerstore/api/payment_means.rb', line 2

def issuer
  @issuer
end

#kindObject 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_digitsObject

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

#ownerObject

Returns the value of attribute owner.



2
3
4
# File 'lib/cornerstore/api/payment_means.rb', line 2

def owner
  @owner
end

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_idObject

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_atObject

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_bicObject

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

Returns:

  • (Boolean)


25
26
27
# File 'lib/cornerstore/api/payment_means.rb', line 25

def paid?
  self.paid_at.is_a?(DateTime)
end

#refunded?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/cornerstore/api/payment_means.rb', line 29

def refunded?
  self.refunded_at.is_a?(DateTime)
end