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-24.2.20 samples/ex_mkyourown.rb
fraser-vpim-0.658 samples/ex_mkyourown.rb
fraser-vpim-0.659 samples/ex_mkyourown.rb
fraser-vpim-rails-0.658 samples/ex_mkyourown.rb
fraser-vpim-rails-0.659 samples/ex_mkyourown.rb
xing-vpim-0.658.1 samples/ex_mkyourown.rb
vpim-13.11.11 samples/ex_mkyourown.rb
vpim2-0.0.1 samples/ex_mkyourown.rb
vpim-rails-reinteractive-0.7 samples/ex_mkyourown.rb
vpim-rails-0.665 samples/ex_mkyourown.rb
thoughtafter-vpim-0.7.0.1 samples/ex_mkyourown.rb
vpim-rails-0.664 samples/ex_mkyourown.rb
vpim-rails-0.663 samples/ex_mkyourown.rb
vpim-rails-0.662 samples/ex_mkyourown.rb
scashin133-vpim-9.4.0 samples/ex_mkyourown.rb
vpim-rails-0.661 samples/ex_mkyourown.rb
mumboe-vpim-0.7 samples/ex_mkyourown.rb
mumboe-vpim-0.695 samples/ex_mkyourown.rb
fairtilizer-vpim-0.695 samples/ex_mkyourown.rb
vpim-0.619 samples/ex_mkyourown.rb