Class: Customer::AddressPresenter
- Inherits:
-
Object
- Object
- Customer::AddressPresenter
- Defined in:
- app/presenters/customer/address_presenter.rb
Instance Method Summary collapse
-
#initialize(address) ⇒ AddressPresenter
constructor
A new instance of AddressPresenter.
- #to_s ⇒ Object
Constructor Details
#initialize(address) ⇒ AddressPresenter
3 4 5 |
# File 'app/presenters/customer/address_presenter.rb', line 3 def initialize(address) @address = address end |
Instance Method Details
#to_s ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/presenters/customer/address_presenter.rb', line 7 def to_s return nil if address.nil? components = [ address.address1, address.address2, address.city, address.state_text, address.zipcode, address.country.to_s ] components.reject(&:blank?) .join(', ') end |