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.
128 129 130 |
# File 'lib/intent/core.rb', line 128 def list @list end |
Instance Method Details
#add_line!(line) ⇒ Object
146 147 148 149 150 |
# File 'lib/intent/core.rb', line 146 def add_line!(line) record = Record.new("#{Date.today} #{line}") @list.prepend(record) @list.save! end |
#all ⇒ Object
134 135 136 |
# File 'lib/intent/core.rb', line 134 def all @list.by_not_done end |
#focused ⇒ Object
138 139 140 |
# File 'lib/intent/core.rb', line 138 def focused @list.by_context('@focus').by_not_done end |
#focused_projects ⇒ Object
142 143 144 |
# File 'lib/intent/core.rb', line 142 def focused_projects focused.map { |t| t.projects }.flatten.uniq end |