Class: Rumember::Transaction
Instance Attribute Summary
Attributes inherited from Abstract
#parent
Instance Method Summary
collapse
Methods inherited from Abstract
boolean_reader, #initialize, integer_reader, reader, time_reader
Methods included from Dispatcher
#dispatch, #lists, #locations, #transaction_dispatch
Instance Method Details
#id ⇒ Object
4
5
6
|
# File 'lib/rumember/transaction.rb', line 4
def id
Integer(@attributes['transaction']['id'])
end
|
#params ⇒ Object
20
21
22
|
# File 'lib/rumember/transaction.rb', line 20
def params
{'transaction_id' => id}
end
|
#response ⇒ Object
16
17
18
|
# File 'lib/rumember/transaction.rb', line 16
def response
@attributes
end
|
#undo ⇒ Object
24
25
26
27
28
29
30
31
|
# File 'lib/rumember/transaction.rb', line 24
def undo
if undone? || !undoable?
false
else
dispatch('transactions.undo')
@undone = true
end
end
|
#undoable? ⇒ Boolean
8
9
10
|
# File 'lib/rumember/transaction.rb', line 8
def undoable?
@attributes['transaction']['undoable'] == '1'
end
|
#undone? ⇒ Boolean
12
13
14
|
# File 'lib/rumember/transaction.rb', line 12
def undone?
!!@undone
end
|