Class: Rumember::Timeline
- Inherits:
-
Object
- Object
- Rumember::Timeline
- Includes:
- Dispatcher
- Defined in:
- lib/rumember/timeline.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
-
#initialize(parent, id = nil) ⇒ Timeline
constructor
A new instance of Timeline.
- #params ⇒ Object
- #smart_add(name) ⇒ Object
Methods included from Dispatcher
#dispatch, #lists, #locations, #transaction_dispatch
Constructor Details
#initialize(parent, id = nil) ⇒ Timeline
Returns a new instance of Timeline.
7 8 9 10 |
# File 'lib/rumember/timeline.rb', line 7 def initialize(parent, id = nil) @parent = parent @id = (id || parent.dispatch('timelines.create').fetch('timeline')).to_i end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/rumember/timeline.rb', line 5 def id @id end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
5 6 7 |
# File 'lib/rumember/timeline.rb', line 5 def parent @parent end |
Instance Method Details
#params ⇒ Object
12 13 14 |
# File 'lib/rumember/timeline.rb', line 12 def params {'timeline' => id} end |
#smart_add(name) ⇒ Object
16 17 18 |
# File 'lib/rumember/timeline.rb', line 16 def smart_add(name) dispatch('tasks.add', 'parse' => 1, 'name' => name) end |