Class: SpreeAdyen::AddressPresenter
- Inherits:
-
Object
- Object
- SpreeAdyen::AddressPresenter
- Defined in:
- app/presenters/spree_adyen/address_presenter.rb
Instance Method Summary collapse
-
#initialize(address) ⇒ AddressPresenter
constructor
A new instance of AddressPresenter.
- #to_h ⇒ Object
Constructor Details
#initialize(address) ⇒ AddressPresenter
Returns a new instance of AddressPresenter.
3 4 5 |
# File 'app/presenters/spree_adyen/address_presenter.rb', line 3 def initialize(address) @address = address end |
Instance Method Details
#to_h ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'app/presenters/spree_adyen/address_presenter.rb', line 7 def to_h { city: address['citystring'], country: Spree::Country.find_by(name: address['countrystring']), zipcode: address['postalCodestring'], address1: address['streetstring'], address2: address['houseNumberOrNamestring'] } end |