Sha256: 3f026d13c0b86389b35eb5a35616bccb8368ecfa8806565fb925350cd16d02c8

Contents?: true

Size: 622 Bytes

Versions: 1

Compression:

Stored size: 622 Bytes

Contents

require 'active_support/core_ext/array'
require 'ostruct'

class ContactPresenter
  attr_reader :contact
  delegate :id, :content_id, :title, :recipient, :street_address, :postal_code,
    :locality, :region, :country_code, :country_name, :email, :contact_form_url,
    :comments, :worldwide_organisation_path, to: :contact

  def initialize(contact)
    @contact = OpenStruct.new(contact)
  end

  def contact_numbers
    Array.wrap(contact[:contact_numbers])
  end

  def has_postal_address?
    recipient.present? || street_address.present? || locality.present? ||
    region.present? || postal_code.present?
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
govspeak-5.0.0 lib/presenters/contact_presenter.rb