-
Notifications
You must be signed in to change notification settings - Fork 2
Things::Person
Persons are accessed via the Things::Person class.
Currently there are no options for fetching a collection of people
Opposed to other classes, Person are created in only one way. You need to call the #create method on the Things::Person class and supply the name of that Person in the Mac OS X Address Book. Only people present in the Address Book may be added to Things:
Things::Person.create('James') # the Person will appear in the People listThings::Person has a few useful methods if you want to fetch a single Person.
The smartest is the Things::Person.find method, which will accept either a name or an id.
Things::Person.find('James') # => #<Things::Person:0x115dd84>
Things::Person.find('11111111-1111-1111-1111-111111111111') # => #<Things::Person:0x115dd84>If you want a more targeted approach, you can use Things::Person.find_by_name or Things::Person.find_by_id
Because of the limitations in the Things API, you cannot edit a Person
To delete a Person, simply call the delete method. The Person will be removed from Things.
person = Things::Person.find('James') # => #<Things::Person:0x115dd84>
person.delete