Class: Things::List
- Inherits:
-
Reference::Base
- Object
- Reference::Base
- Things::List
- Defined in:
- lib/things/list.rb
Constant Summary collapse
- DEFAULTS =
[:inbox, :today, :next, :scheduled, :someday, :projects, :logbook, :trash]
Instance Attribute Summary
Attributes inherited from Reference::Base
Class Method Summary collapse
- .all ⇒ Object
-
.build(reference) ⇒ Object
build a new instance and link it to the supplied reference.
-
.convert(references) ⇒ Object
Converts a collection of reference into a collection of objects.
-
.reference ⇒ Object
Returns an Appscript Reference to the entire collection of todos.
Instance Method Summary collapse
Class Method Details
.all ⇒ Object
23 24 25 |
# File 'lib/things/list.rb', line 23 def all convert(reference.get) end |
.build(reference) ⇒ Object
build a new instance and link it to the supplied reference
Returns a object associated with a reference
30 31 32 33 34 |
# File 'lib/things/list.rb', line 30 def build(reference) todo = self.new todo.reference = reference todo end |
.convert(references) ⇒ Object
Converts a collection of reference into a collection of objects
18 19 20 21 |
# File 'lib/things/list.rb', line 18 def convert(references) references = [references] if !references.is_a?(Array) references.collect { |todo| build(todo) } end |