multicash 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/multicash/payment_order.rb +15 -9
- data/multicash.gemspec +2 -2
- 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: 2934f0c6a9738ee90df45b12650f01b604866094
|
4
|
+
data.tar.gz: 82a90df7b4e71881f117ae054c2cb831050787ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98abc1dfdfa5442883016e225a8b92f61459cf6e7a0aa8ef71dbed3d899a63360ab5995b6595ca82b67b911e4e934e4c24724f69fe90ee08d615d17afff6b29b
|
7
|
+
data.tar.gz: 1fb2d961e5ad960d20291e4071b3f7525772c542df2a18c6b649eabf09b25480f49896191f7d158f7932d27c9898f29f6cc7f3fa3833f6bffc2ceb8304840cb7
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
@@ -6,6 +6,8 @@ module Multicash
|
|
6
6
|
attr_accessor :reference, :transfers_number, :errors
|
7
7
|
attr_reader :transfers, :total_ammount, :currency, :ordering_bae, :date
|
8
8
|
|
9
|
+
validate :valid_transfers
|
10
|
+
|
9
11
|
def initialize
|
10
12
|
@currency = nil
|
11
13
|
@date = Time.now.strftime('%y%m%d')
|
@@ -16,15 +18,11 @@ module Multicash
|
|
16
18
|
end
|
17
19
|
|
18
20
|
def << (transfer)
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
@ordering_bae ||= transfer.ordering_bae
|
25
|
-
else
|
26
|
-
errors.add("transfer - #{@transfers.size}", transfer.errors.full_messages)
|
27
|
-
end
|
21
|
+
@transfers << transfer
|
22
|
+
transfer.reference_counter = @transfers.size
|
23
|
+
@total_ammount += (transfer.ammount.to_f)
|
24
|
+
@currency ||= transfer.currency
|
25
|
+
@ordering_bae ||= transfer.ordering_bae
|
28
26
|
end
|
29
27
|
|
30
28
|
def header
|
@@ -76,5 +74,13 @@ module Multicash
|
|
76
74
|
|
77
75
|
bank_file
|
78
76
|
end
|
77
|
+
|
78
|
+
private
|
79
|
+
|
80
|
+
def valid_transfers
|
81
|
+
transfers.each_with_index do |transfer, index|
|
82
|
+
self.errors.add("transfer_#{index}", transfer.errors.full_messages) unless transfer.valid?
|
83
|
+
end
|
84
|
+
end
|
79
85
|
end
|
80
86
|
end
|
data/multicash.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: multicash 0.0.
|
5
|
+
# stub: multicash 0.0.6 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "multicash"
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.6"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.authors = ["Anton Yordanov"]
|