I''m using vpim/maker/vcard and I want to add a field for Organization ("ORG"), which doesn''t seem to be supported out of the box. However, when I try to use the add_field method, it fails inexplicably, and the rDoc is somewhat less than helpful. Here''s my error: undefined method `encode'' for "Fake Company":String #{RAILS_ROOT}/lib/vpim/dirinfo.rb:197:in `to_s'' #{RAILS_ROOT}/lib/vpim/dirinfo.rb:197:in `collect'' #{RAILS_ROOT}/lib/vpim/dirinfo.rb:197:in `to_s'' #{RAILS_ROOT}/app/models/rsvp.rb:39:in `gen_vcard'' #{RAILS_ROOT}/app/controllers/rsvp_controller.rb:23:in `catch'' Any advice on the proper syntax for add_field? Thanks. -Ian Westcott application developer/ support specialist the barbarian group, llc 338 newbury street, 3rd floor boston, ma 02115-2700 ianw at barbariangroup.com 617-424-8887
Scratch that. I solved my own problem. I had assumed that add_field took a string or hash, but after browsing the source, I tried (add_field(Vpim::DirectoryInfo::Field.create(''ORG'', myorgvar )) and it worked. This may warrant an update of the rDoc for the add_field method... thoughts? -Ian Westcott application developer/ support specialist the barbarian group, llc 338 newbury street, 3rd floor boston, ma 02115-2700 ianw at barbariangroup.com 617-424-8887 On Nov 17, 2005, at 1:08 PM, Ian Westcott wrote:> I''m using vpim/maker/vcard and I want to add a field for Organization > ("ORG"), which doesn''t seem to be supported out of the box. However, > when I try to use the add_field method, it fails inexplicably, and > the rDoc is somewhat less than helpful. > > Here''s my error: > > undefined method `encode'' for "Fake Company":String > > #{RAILS_ROOT}/lib/vpim/dirinfo.rb:197:in `to_s'' > #{RAILS_ROOT}/lib/vpim/dirinfo.rb:197:in `collect'' > #{RAILS_ROOT}/lib/vpim/dirinfo.rb:197:in `to_s'' > #{RAILS_ROOT}/app/models/rsvp.rb:39:in `gen_vcard'' > #{RAILS_ROOT}/app/controllers/rsvp_controller.rb:23:in `catch'' > > Any advice on the proper syntax for add_field? > > Thanks. > > -Ian Westcott > > application developer/ > support specialist > the barbarian group, llc > 338 newbury street, 3rd floor > boston, ma 02115-2700 > ianw at barbariangroup.com > 617-424-8887 > > > _______________________________________________ > Vpim-talk mailing list > Vpim-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/vpim-talk > >
On Thu, Nov 17, 2005 at 01:20:00PM -0500, Ian Westcott wrote:> Scratch that. I solved my own problem. I had assumed that add_field > took a string or hash, but after browsing the source, I tried > (add_field(Vpim::DirectoryInfo::Field.create(''ORG'', myorgvar )) and > it worked. > > This may warrant an update of the rDoc for the add_field method... > thoughts?Well, if it wasn''t clear, something needs to be fixed! My intention is that every argument called "field" be of the class Field. The text now is : Add an arbitrary field, field. Maybe if I changed it to: Add an arbitrary Field, field. rdoc would helpfully link the "Field" to the class definition, I''ll try that. It''ll be a month though, my computer and src base is being shipped from Toronto to Vancouver right now. Thanks for reporting this, Sam