Class: Intent::Core::Inbox
- Inherits:
-
Object
- Object
- Intent::Core::Inbox
- Defined in:
- lib/intent/core.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.
129 130 131 |
# File 'lib/intent/core.rb', line 129 def list @list end |
Instance Method Details
#add_line!(line) ⇒ Object
147 148 149 150 151 |
# File 'lib/intent/core.rb', line 147 def add_line!(line) record = Record.new("#{Date.today} #{line}") @list.prepend(record) @list.save! end |
#all ⇒ Object
135 136 137 |
# File 'lib/intent/core.rb', line 135 def all @list.by_not_done end |
#focused ⇒ Object
139 140 141 |
# File 'lib/intent/core.rb', line 139 def focused @list.by_context('@focus').by_not_done end |
#focused_projects ⇒ Object
143 144 145 |
# File 'lib/intent/core.rb', line 143 def focused_projects focused.map { |t| t.projects }.flatten.uniq end |