Class: Intent::Core::Inbox
- Inherits:
-
Object
- Object
- Intent::Core::Inbox
- Defined in:
- lib/intent/core/inbox.rb
Instance Attribute Summary collapse
-
#list ⇒ Object
readonly
Returns the value of attribute list.
Instance Method Summary collapse
- #add_line!(line) ⇒ Object
- #all ⇒ Object
- #focused ⇒ Object
- #focused_projects ⇒ Object
-
#initialize(db_path) ⇒ Inbox
constructor
A new instance of Inbox.
Constructor Details
Instance Attribute Details
#list ⇒ Object (readonly)
Returns the value of attribute list.
4 5 6 |
# File 'lib/intent/core/inbox.rb', line 4 def list @list end |
Instance Method Details
#add_line!(line) ⇒ Object
22 23 24 25 26 |
# File 'lib/intent/core/inbox.rb', line 22 def add_line!(line) record = Record.new("#{Date.today} #{line}") @list.prepend(record) @list.save! end |
#all ⇒ Object
10 11 12 |
# File 'lib/intent/core/inbox.rb', line 10 def all @list.by_not_done end |
#focused ⇒ Object
14 15 16 |
# File 'lib/intent/core/inbox.rb', line 14 def focused @list.by_context('@focus').by_not_done end |
#focused_projects ⇒ Object
18 19 20 |
# File 'lib/intent/core/inbox.rb', line 18 def focused_projects focused.map { |t| t.projects }.flatten.uniq end |