Closed VGraupera closed 11 years ago
This sounds like a great idea.
Were you imagining the API to be something like this?
people = AddressBook::Person.all
AddressBook::Person.vcards_for(people)
# returns an array of vcards
and
alex = AddressBook::Person.find_by_email('alex@example.com')
alex.to_vcard
# returns one vcard
ABPersonCreateVCardRepresentationWithPeople
returns a NSConcreteData
object. But RubyMotion seems to stringify those correctly, so I don't know if it's necessary to explicitly call to_s
on the value.
The VCardRepresentation
is just a single giant string, not an array of strings, regardless of whether you give it a single Person record or multiple. There's no "VCard object". So perhaps we should just imitate the iOS naming convention: AddressBook::Person.vcard_representation_for(people)
?
Added with commit 1ee2f31. Any reactions?
Wow, very nicely done. And that was fast. Really appreciate this. I will try it out.
I didnt find a wrapper for ABPersonCreateVCardRepresentationWithPeople. Can it be added? Thanks.