bean_sprout 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/bean_sprout/ledger.rb +7 -8
- data/lib/bean_sprout/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f1cb8b063d609c6b1734ced03dea9ea338bd31f
|
4
|
+
data.tar.gz: 08c5d0e268e47b4073b41992e865a635cac595e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfd89409a85cc59d047363debe7baacdf14e3e7e9020684ae12625c4e0aec9722dbb0656dc9966345dc6fa35a35e04ba95c8ebc3f36aab82c3b4c9ca52941350
|
7
|
+
data.tar.gz: 141d728280ff6fd755c2e2aca24f56c11baf8e0388976801ab37aafffa80bda7d9ad1c3f59eae826954d09452155f1cc1b6fe1594eee567fd97fee43ee8549ba
|
data/lib/bean_sprout/ledger.rb
CHANGED
@@ -39,12 +39,7 @@ module BeanSprout
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def create_transaction entries, other_data: nil
|
42
|
-
|
43
|
-
sprout_bunch = @sprout_bunches.store do |next_id|
|
44
|
-
SproutBunch.new(next_id, sprouts)
|
45
|
-
end
|
46
|
-
|
47
|
-
Transaction.new(sprout_bunch, other_data)
|
42
|
+
commit_entries entries, other_data
|
48
43
|
end
|
49
44
|
|
50
45
|
def transfer from_acc, to_acc, amount, other_data: nil
|
@@ -109,9 +104,13 @@ module BeanSprout
|
|
109
104
|
end
|
110
105
|
|
111
106
|
def commit_entries entries, other_data = nil
|
112
|
-
|
107
|
+
sprouts = entries.map do |entry| get_target entry end
|
108
|
+
sprout_bunch = @sprout_bunches.store do |next_id|
|
109
|
+
SproutBunch.new(next_id, sprouts)
|
110
|
+
end
|
111
|
+
|
112
|
+
trans = Transaction.new(sprout_bunch, other_data)
|
113
113
|
trans.commit
|
114
|
-
trans.other_data = other_data
|
115
114
|
trans
|
116
115
|
end
|
117
116
|
end
|
data/lib/bean_sprout/version.rb
CHANGED