Sha256: b02f543a3e60ff01881129b057cef68e1a6f9168515e2e3cc3dd3c565be19db2
Contents?: true
Size: 758 Bytes
Versions: 40
Compression:
Stored size: 758 Bytes
Contents
class Ppl::Format::Contact::PostalAddress < Ppl::Format::Contact attr_writer :table def initialize @table = Ppl::Format::Table.new([:label, :value]) end def process(contact) address = contact.postal_address if !address.nil? { :street => "Street", :postal_code => "Postal Code", :po_box => "PO box", :locality => "Locality", :region => "Region", :country => "Country", }.each do |property, name| value = address.send(property) next if value.nil? || value == "" @table.add_row({ :label => sprintf("%s:", name), :value => address.send(property) }) end end return @table.to_s end end
Version data entries
40 entries across 40 versions & 1 rubygems