Class: SpreeStripe::CustomerPresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/spree_stripe/customer_presenter.rb

Instance Method Summary collapse

Constructor Details

#initialize(address: nil, email: nil, name: nil) ⇒ CustomerPresenter

Returns a new instance of CustomerPresenter.



3
4
5
6
7
# File 'app/presenters/spree_stripe/customer_presenter.rb', line 3

def initialize(address: nil, email: nil, name: nil)
  @email = email
  @name = name
  @address = address
end

Instance Method Details

#callObject



9
10
11
12
13
14
15
16
# File 'app/presenters/spree_stripe/customer_presenter.rb', line 9

def call
  hash = {}
  hash[:address] = address_payload if address.present?
  hash[:email] = email if email.present?
  hash[:name] = name if name.present?

  hash
end