Class: Govspeak::ContactPresenter
- Inherits:
-
Object
- Object
- Govspeak::ContactPresenter
- Defined in:
- lib/govspeak/presenters/contact_presenter.rb
Instance Attribute Summary collapse
-
#contact ⇒ Object
readonly
Returns the value of attribute contact.
Instance Method Summary collapse
- #contact_numbers ⇒ Object
- #has_postal_address? ⇒ Boolean
-
#initialize(contact) ⇒ ContactPresenter
constructor
A new instance of ContactPresenter.
Constructor Details
#initialize(contact) ⇒ ContactPresenter
Returns a new instance of ContactPresenter.
11 12 13 |
# File 'lib/govspeak/presenters/contact_presenter.rb', line 11 def initialize(contact) @contact = OpenStruct.new(contact) end |
Instance Attribute Details
#contact ⇒ Object (readonly)
Returns the value of attribute contact.
6 7 8 |
# File 'lib/govspeak/presenters/contact_presenter.rb', line 6 def contact @contact end |
Instance Method Details
#contact_numbers ⇒ Object
15 16 17 |
# File 'lib/govspeak/presenters/contact_presenter.rb', line 15 def contact_numbers Array.wrap(contact[:contact_numbers]) end |
#has_postal_address? ⇒ Boolean
19 20 21 22 |
# File 'lib/govspeak/presenters/contact_presenter.rb', line 19 def has_postal_address? recipient.present? || street_address.present? || locality.present? || region.present? || postal_code.present? end |