Sha256: 35cdd5f15cf2df78474b69042d60c2ec5bc1fa71a988e1a6f40d575abd6d2636

Contents?: true

Size: 548 Bytes

Versions: 2

Compression:

Stored size: 548 Bytes

Contents

class Contacts
  class Vcf < Base
    
    def initialize(file)
      @contact_file = file
    end
    
    def contacts
      contacts = Array.new
      i = 0
      @contact_file.each do |line|
        contacts[i] = Array.new unless contacts[i]
        if line.match(/FN:/)
          contacts[i] << line.gsub(/FN:/, '').strip
        elsif line.match(/EMAIL;/)
          contacts[i] << line.gsub(/^.*:/, '').strip
        elsif line.match(/END:VCARD/)
          i += 1
        end
      end
      contacts
    end
  end
  FILETYPES[:vcf] = Vcf
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
pp-contacts-1.5.2 lib/contacts/vcf.rb
muck-contacts-2.6.1 lib/contacts/vcf.rb