Sha256: 8e937619a20056bfdd04e3e963b3e6d1053e42985ea299de3be69b6c55e0df74

Contents?: true

Size: 1.43 KB

Versions: 24

Compression:

Stored size: 1.43 KB

Contents

require 'vpim/vcard'

card = Vpim::Vcard::Maker.make2 do |maker|
  maker.add_name do |name|
    name.prefix = 'Dr.'
    name.given = 'Jimmy'
    name.family = 'Death'
  end

  maker.add_addr do |addr|
    addr.preferred = true
    addr.location = 'work'
    addr.street = '12 Last Row, 13th Section'
    addr.locality = 'City of Lost Children'
    addr.country = 'Cinema'
  end

  maker.add_addr do |addr|
    addr.location = [ 'home', 'zoo' ]
    addr.delivery = [ 'snail', 'stork', 'camel' ]
    addr.street = '12 Last Row, 13th Section'
    addr.locality = 'City of Lost Children'
    addr.country = 'Cinema'
  end

  maker.nickname = "The Good Doctor"

  maker.birthday = Date.today

  maker.add_photo do |photo|
    photo.link = 'http://example.com/image.png'
  end

  maker.add_photo do |photo|
    photo.image = "File.open('drdeath.jpg').read # a fake string, real data is too large :-)"
    photo.type = 'jpeg'
  end

  maker.add_tel('416 123 1111')

  maker.add_tel('416 123 2222') { |t| t.location = 'home'; t.preferred = true }

  maker.add_impp('joe') do |impp|
    impp.preferred = 'yes'
    impp.location = 'mobile'
  end

  maker.add_x_aim('example') do |xaim|
    xaim.location = 'row12'
  end

  maker.add_tel('416-123-3333') do |tel|
    tel.location = 'work'
    tel.capability = 'fax'
  end

  maker.add_email('drdeath@work.com') { |e| e.location = 'work' }

  maker.add_email('drdeath@home.net') { |e| e.preferred = 'yes' }

end

puts card

Version data entries

24 entries across 24 versions & 11 rubygems

Version Path
vpim-24.2.20 samples/ex_mkvcard.rb
fraser-vpim-0.658 samples/ex_mkvcard.rb
fraser-vpim-0.659 samples/ex_mkvcard.rb
fraser-vpim-rails-0.658 samples/ex_mkvcard.rb
fraser-vpim-rails-0.659 samples/ex_mkvcard.rb
xing-vpim-0.658.1 samples/ex_mkvcard.rb
vpim-13.11.11 samples/ex_mkvcard.rb
vpim2-0.0.1 samples/ex_mkvcard.rb
vpim-rails-reinteractive-0.7 samples/ex_mkvcard.rb
vpim-rails-0.665 samples/ex_mkvcard.rb
thoughtafter-vpim-0.7.0.1 samples/ex_mkvcard.rb
vpim-rails-0.664 samples/ex_mkvcard.rb
vpim-rails-0.663 samples/ex_mkvcard.rb
vpim-rails-0.662 samples/ex_mkvcard.rb
scashin133-vpim-9.4.0 samples/ex_mkvcard.rb
vpim-rails-0.661 samples/ex_mkvcard.rb
mumboe-vpim-0.7 samples/ex_mkvcard.rb
mumboe-vpim-0.695 samples/ex_mkvcard.rb
fairtilizer-vpim-0.695 samples/ex_mkvcard.rb
vpim-0.658 samples/ex_mkvcard.rb