Sha256: ea8f2cb2fa9727208dbfc54544f70313af811e6e1d73f4198091a3b0c547cb82

Contents?: true

Size: 878 Bytes

Versions: 24

Compression:

Stored size: 878 Bytes

Contents

# Note that while most version 3.0 vCards should be valid 2.1 vCards, they
# aren't guaranteed to be. vCard 2.1 is reasonably well supported on decode,
# I'm not sure how well it works on encode.
#
# Most things should work, but you should test whether this works with your 2.1
# vCard decoder. Also, avoid base64 encoding, or do it manually.
require 'vpim/vcard'

# Create a new 2.1 vCard.
card21 = Vpim::DirectoryInfo.create(
  [
    Vpim::DirectoryInfo::Field.create('VERSION', '2.1')
  ], 'VCARD')

Vpim::Vcard::Maker.make2(card21) do |maker|
  maker.name do |n|
    n.prefix = 'Dr.'
    n.given = 'Jimmy'
    n.family = 'Death'
  end

end

puts card21

# Copy and modify a 2.1 vCard, preserving it's version.
mod21 = Vpim::Vcard::Maker.make2(Vpim::DirectoryInfo.create([], 'VCARD')) do |maker|
  maker.copy card21
  maker.nickname = 'some name'
end

puts '---'
puts mod21

Version data entries

24 entries across 24 versions & 11 rubygems

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