Sha256: 66934b5ed4d73b0ac2dc30620f5cead8e6afdbd6ca762dca6defed6990dc6ad8
Contents?: true
Size: 676 Bytes
Versions: 11
Compression:
Stored size: 676 Bytes
Contents
require 'active_support/core_ext/array' require 'ostruct' module Govspeak 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 end
Version data entries
11 entries across 11 versions & 1 rubygems