On Wed, Jun 18, 2008 at 11:45 AM, Joost Hietbrink <joost at joopp.com>
wrote:> Hi Sam,
> Thanks for your quick response. This is what I''m doing:
> def to_vcf(options = {})
> card = Vpim::Vcard::Maker.make2 do |maker|
> maker.add_addr do |addr|
> addr.location = ''work''
> addr.street = self.street_address
> addr.locality = self.locality
> addr.region = self.administrative_area
> addr.postalcode = self.postal_code
> addr.country = self.country
> end
> end
> If I''m correct all things put in are String. But maybe
I''m wrong?
Or maybe there is a bug. Can you send the complete stack trace?
Sam
> Cheers,
> Joost
>
> An email from Joopp.
>
> Joost Hietbrink
>
> Call me +31 (0)6 14896541
> Skype me joosthietbrink
> Mail me joost at joopp.com
> Visit us Joopp.
> Patrijsweg 74
> 2289EX Rijswijk
> On Jun 18, 2008, at 6:58 PM, Sam Roberts wrote:
>
> On Wed, Jun 18, 2008 at 6:32 AM, Joost Hietbrink <joost at joopp.com>
wrote:
>
> Hi Sam Roberts,
>
> First of all. Thanks for the Vpim gem. We use it at www.yelloyello.com and
>
> it works great.
>
> I''m glad to hear that.
>
> We''ve only encountered the following error:
>
> # NoMethodError (undefined method `to_str'' for []:Array):
>
> #
>
> /usr/local/lib/ruby/gems/1.8/gems/vpim-0.619/lib/vpim/rfc2425.rb:256:in
>
> `encode_text''
>
> Maybe it should state .to_s instead of .to_str ?
>
> I don''t have the code in front of me, but you are trying to
encode a
> text field, it seems (#encode_text), so you need to pass it something
> that is "text", but are passing a compound data type (an Array).
>
> Using #to_s would "work" in the sense that it would silently
produce
> garbage:
> irb(main):001:0> STDIN.to_s
> => "#<IO:0x2ad22ad66f10>"
> irb(main):002:0> ["sam","roberts"].to_s
> => "samroberts"
>
> #to_s is intended for debugging/logging purposes, not for clubbing
> everything into string form.
>
> What field are you setting, whats in the Array you are using as input,
> and what do you expect it to be in the vCard (or iCalendar)?
>
> Cheers,
> Sam
>
>