Sha256: 39aa32ece5344031de4b2f0b68975dfbbae2af0f26598d6ed798be96d0aa6270

Contents?: true

Size: 649 Bytes

Versions: 24

Compression:

Stored size: 649 Bytes

Contents

require 'vpim/vcard'

module Vpim
  class  Vcard
    class Maker
      # Add a user-defined field, X-MY-OWN:.
      #
      # This can be done both to encode custom fields, or to add support for
      # fields that Vcard::Maker doesn't support. In the latter case, please
      # submit your methods so I can add them to vPim.
      def add_my_own(value)
        @card << Vpim::DirectoryInfo::Field.create( 'X-MY-OWN', value.to_str );
      end
    end
  end
end


card = Vpim::Vcard.create # ... or load from somewhere

Vpim::Vcard::Maker.make2(card) do |m|
  m.add_name do |n|
    n.given = 'Given'
  end
  m.add_my_own 'my value'
end

puts card

Version data entries

24 entries across 24 versions & 11 rubygems

Version Path
vpim-0.602 samples/ex_mkyourown.rb
vpim-0.604 samples/ex_mkyourown.rb
vpim-0.658 samples/ex_mkyourown.rb
vpim-0.695 samples/ex_mkyourown.rb