Sha256: d4de84ca2f2cb54fe10f9b2fa6078edcf0500d53c0c7116665c1b9b26c1a6707
Contents?: true
Size: 927 Bytes
Versions: 20
Compression:
Stored size: 927 Bytes
Contents
class Ppl::Entity::Contact attr_accessor :id attr_accessor :name attr_accessor :nicknames attr_accessor :email_addresses attr_accessor :birthday attr_accessor :phone_numbers attr_accessor :organizations attr_accessor :postal_address attr_accessor :urls def initialize @email_addresses = [] @nicknames = [] @organizations = [] @phone_numbers = [] @urls = [] end def set_postal_address if @postal_address.nil? @postal_address = Ppl::Entity::PostalAddress.new end yield @postal_address end def has_email_address?(email_address) @email_addresses.include? email_address end def age(on_date) if @birthday.nil? nil else # From http://stackoverflow.com/a/2357790 on_date.year - @birthday.year - ((on_date.month > @birthday.month || (on_date.month == @birthday.month && on_date.day >= @birthday.day)) ? 0 : 1) end end end
Version data entries
20 entries across 20 versions & 1 rubygems