Class: Rumember::Timeline

Inherits:
Object
  • Object
show all
Includes:
Dispatcher
Defined in:
lib/rumember/timeline.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/rumember/timeline.rb', line 5

def id
  @id
end

#parentObject (readonly)

Returns the value of attribute parent.



5
6
7
# File 'lib/rumember/timeline.rb', line 5

def parent
  @parent
end

Instance Method Details

#paramsObject



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