ruby_ufebs 0.2.2 → 0.2.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25d4ed27cf8eb6616b9c44aa309d1ed569135068
4
- data.tar.gz: 0d9bb2fb8f00973dde893cef59170c118dcb05ed
3
+ metadata.gz: ec810416c2556466033b7b703dde1236d4525e40
4
+ data.tar.gz: 58e0578544a9ac21c5fd46f35c809bec48d29da7
5
5
  SHA512:
6
- metadata.gz: 4304bdbc895b79b18d070e135c4a7ca895de7ef77e03ce9bf5a02be34aca9087c2a067553e548e8d05d85a2d86360e0da6553317d3b38af4bd9eb553b3cb1972
7
- data.tar.gz: 42bf550fd30d5cd5ddf53f406a132dee39df79d34236d5beb22ebce325192ed66d6b37c63ea4d9c009cc077077e88ac680ea0ff5c6fd860e6e70e30bdaaf8a37
6
+ metadata.gz: 323f0353f7dc2452ad1e72cc97d038d71d08e328f0004175cd100f8903500cff0b6dcf4e4db69621a515724b8751d674db140715dfef27f1f6918a156405ffe2
7
+ data.tar.gz: e0730eee134186b52d8101070801eea1646b09119b7b359a9d6d61d866146c71eeaa61f7a9227b04ca045644ba2a1d9e503bf680c81ec089ef38a7b9dead4baf
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  /.bundle/
2
+ /.idea
2
3
  /.yardoc
3
4
  /Gemfile.lock
4
5
  /_yardoc/
data/README.md CHANGED
@@ -22,6 +22,12 @@ gem 'ruby_ufebs'
22
22
 
23
23
  $ gem install ruby_ufebs
24
24
 
25
+ ## Generate doc
26
+
27
+ ```sh
28
+ yard doc
29
+ ```
30
+
25
31
  ## Usage
26
32
 
27
33
  Configuration:
@@ -100,4 +106,4 @@ Guard: `guard`
100
106
 
101
107
  ## Contributing
102
108
 
103
- Bug reports and pull requests are welcome on GitHub at https://github.com/creepycheese/ruby_ufebs
109
+ Bug reports and pull requests are welcome on GitHub at https://github.com/creepycheese/ruby_ufebs
@@ -0,0 +1,20 @@
1
+ module Ufebs
2
+ module Entities
3
+ class EdRefId
4
+ include HappyMapper
5
+ register_namespace 'ed', 'urn:cbr-ru:ed:v2.0'
6
+ namespace 'ed'
7
+ tag 'EDRefID'
8
+
9
+ attribute :ed_no, String, tag: 'EDNo'
10
+ attribute :ed_date, String, tag: 'EDDate'
11
+ attribute :ed_author, String, tag: 'EDAuthor'
12
+
13
+ def initialize(params = {})
14
+ params.each do |key, value|
15
+ instance_variable_set("@#{key}".to_sym, value)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,33 @@
1
+ require_relative 'ed_ref_id'
2
+
3
+ module Ufebs
4
+ module Entities
5
+ class TransInfo
6
+ include HappyMapper
7
+ register_namespace 'ed', 'urn:cbr-ru:ed:v2.0'
8
+ namespace 'ed'
9
+ tag 'TransInfo'
10
+
11
+ attribute :acc_doc_no, String, tag: 'AccDocNo'
12
+ attribute :bic_corr, String, tag: 'BICCorr'
13
+ attribute :dc, String, tag: 'DC'
14
+ attribute :payee_personal_acc, String, tag: 'PayeePersonalAcc'
15
+ attribute :payer_personal_acc, String, tag: 'PayerPersonalAcc'
16
+ attribute :sum, String, tag: 'Sum'
17
+ attribute :trans_kind, String, tag: 'TransKind'
18
+ attribute :turnover_kind, String, tag: 'TurnoverKind'
19
+ attribute :cash_doc_no, String, tag: 'CashDocNo'
20
+
21
+ has_one :ed_ref_id, ::Ufebs::Entities::EdRefId
22
+
23
+ def initialize(params = {})
24
+ params.each do |key, value|
25
+ case key.to_sym
26
+ when :ed_ref_id then @ed_ref_id = Ufebs::Entities::EdRefId.new(value)
27
+ else instance_variable_set("@#{key}".to_sym, value)
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -4,34 +4,44 @@ module Ufebs
4
4
  include HappyMapper
5
5
  include Ufebs::Fields::Header
6
6
 
7
- register_namespace 'ed', "urn:cbr-ru:ed:v2.0"
7
+ register_namespace 'ed', 'urn:cbr-ru:ed:v2.0'
8
8
  tag 'ED211'
9
9
  namespace 'ed'
10
10
 
11
- attribute :abstract_date, String, tag: 'AbstractDate'
12
- attribute :abstract_kind, String, tag: 'AbstractKind'
13
- attribute :acc, String, tag: 'Acc'
14
- attribute :bic, String, tag: 'BIC'
15
- attribute :end_time, String, tag: 'EndTime'
16
- attribute :enter_bal, String, tag: 'EnterBal'
17
- attribute :inquiry_session, String, tag: 'InquirySession'
18
- attribute :last_movet_date, String, tag: 'LastMovetDate'
19
- attribute :out_bal, String, tag: 'OutBal'
20
- attribute :reserved_sum, String, tag: 'ReservedSum'
21
- attribute :credit_limit_sum, String, tag: 'CreditLimitSum'
11
+ attribute :abstract_date, String, tag: 'AbstractDate'
12
+ attribute :abstract_kind, String, tag: 'AbstractKind'
13
+ attribute :acc, String, tag: 'Acc'
14
+ attribute :bic, String, tag: 'BIC'
15
+ attribute :end_time, String, tag: 'EndTime'
16
+ attribute :enter_bal, String, tag: 'EnterBal'
17
+ attribute :inquiry_session, String, tag: 'InquirySession'
18
+ attribute :last_movet_date, String, tag: 'LastMovetDate'
19
+ attribute :out_bal, String, tag: 'OutBal'
20
+ attribute :reserved_sum, String, tag: 'ReservedSum'
21
+ attribute :credit_limit_sum, String, tag: 'CreditLimitSum'
22
22
  attribute :rtgs_unconfirmed_ed, String, tag: 'RTGSUnconfirmedED'
23
- attribute :arrest_sum, String, tag: 'ArrestSum'
24
- attribute :part_aggregate_id, String, tag: 'PartAggregateID'
23
+ attribute :arrest_sum, String, tag: 'ArrestSum'
24
+ attribute :part_aggregate_id, String, tag: 'PartAggregateID'
25
+ attribute :debit_sum, String, tag: 'DebetSum'
26
+ attribute :credit_sum, String, tag: 'CreditSum'
27
+
28
+ has_many :trans_infos, Ufebs::Entities::TransInfo
25
29
 
26
30
  def initialize(params = {})
27
31
  params.each do |key, value|
28
- @abstract_date = Date.parse(value.to_s).strftime('%Y-%m-%d') if key.to_sym == :abstract_date
29
- @end_time = DateTime.parse(value.to_s).strftime('%H:%M:%S') if key.to_sym == :end_time
30
- @last_movet_date = Date.parse(value.to_s).strftime('%Y-%m-%d') if key.to_sym == :last_movet_date
31
-
32
- instance_variable_set("@#{key}".to_sym, value)
32
+ case key.to_sym
33
+ when :abstract_date then @abstract_date = Date.parse(value.to_s).strftime('%Y-%m-%d')
34
+ when :end_time then @end_time = DateTime.parse(value.to_s).strftime('%H:%M:%S')
35
+ when :last_movet_date then @last_movet_date = Date.parse(value.to_s).strftime('%Y-%m-%d')
36
+ when :trans_infos then @trans_infos = set_trans_infos(value)
37
+ else instance_variable_set("@#{key}".to_sym, value)
38
+ end
33
39
  end
34
40
  end
41
+
42
+ def set_trans_infos(value)
43
+ value.map { |params| Ufebs::Entities::TransInfo.new(params) }
44
+ end
35
45
  end
36
46
  end
37
47
  end
data/lib/ufebs/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RubyUfebs
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_ufebs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Burdaev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-26 00:00:00.000000000 Z
11
+ date: 2018-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -428,9 +428,11 @@ files:
428
428
  - lib/ufebs/entities/acc_doc.rb
429
429
  - lib/ufebs/entities/bank.rb
430
430
  - lib/ufebs/entities/departmental_info.rb
431
+ - lib/ufebs/entities/ed_ref_id.rb
431
432
  - lib/ufebs/entities/participant.rb
432
433
  - lib/ufebs/entities/processing_details.rb
433
434
  - lib/ufebs/entities/session.rb
435
+ - lib/ufebs/entities/trans_info.rb
434
436
  - lib/ufebs/fields/header.rb
435
437
  - lib/ufebs/requests/group_request.rb
436
438
  - lib/ufebs/requests/package_request.rb