Class: Things::Person
- Inherits:
-
Reference::Record
- Object
- Reference::Base
- Reference::Record
- Things::Person
- Defined in:
- lib/things/person.rb
Overview
Things::Person
People in Things cannot be created, they are fetched from Address Book
Instance Attribute Summary
Attributes inherited from Reference::Base
Class Method Summary collapse
- .all ⇒ Object
-
.create(address_book_name) ⇒ Object
Find a Person in Address Book and add a teammate in Things.
Instance Method Summary collapse
-
#delete ⇒ Object
Deletes a Person.
-
#save ⇒ Object
Not supported by Things::Person.
- #todos ⇒ Object
Methods inherited from Reference::Record
build, collection, convert, find, find_by_id, find_by_name, identifier, #initialize, #new?, properties
Methods included from Reference::Inheritance
#inheritable_attributes, #inherited
Constructor Details
This class inherits a constructor from Things::Reference::Record
Class Method Details
.all ⇒ Object
23 24 25 |
# File 'lib/things/person.rb', line 23 def all convert(Things::App.instance.people.get) end |
.create(address_book_name) ⇒ Object
Find a Person in Address Book and add a teammate in Things
Returns a Things::Person object
17 18 19 20 21 |
# File 'lib/things/person.rb', line 17 def create(address_book_name) reference = Things::App.instance.add_teammate_named(address_book_name) raise 'Could not find person in Address Book' if reference == :missing_value build(reference) end |
Instance Method Details
#delete ⇒ Object
Deletes a Person
41 42 43 |
# File 'lib/things/person.rb', line 41 def delete reference.delete end |
#save ⇒ Object
Not supported by Things::Person
Raises a RuntimeError when called
36 37 38 |
# File 'lib/things/person.rb', line 36 def save raise 'Currently Things does not support this method' end |