rus_bank 0.9.0 → 0.9.1
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/rus_bank.rb +7 -7
- data/rus_bank.gemspec +5 -4
- data/test/test_rus_bank.rb +20 -20
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 365b441fbd3e400f807e8a53fa216fb1c8bead55
|
4
|
+
data.tar.gz: 1791c394f892273b423f309e033f3e23ef08c9ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0afbe2fd9e8f388a7ac6efab1406a1977af5dcad0d73442d2255f9098aff2b3b78d543b0a7c23190ad93b11fbcbd54a7eebfac4f9170d8b7d6c932a5be91a97a
|
7
|
+
data.tar.gz: b503b7560baff1910fc4b0576debb71ef85e20ddee51bf616b92bc6596735ccb3ae7e81acb6b120d5c8fd3b4c4e67ec4bdca728277db5d4a40d31cc8cfc69e67
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.1
|
data/lib/rus_bank.rb
CHANGED
@@ -30,41 +30,41 @@ class RusBank
|
|
30
30
|
call(:int_code_to_reg_num, params)
|
31
31
|
end
|
32
32
|
|
33
|
-
def
|
33
|
+
def SearchByRegionCode(region_code)
|
34
34
|
params = { "RegCode" => region_code }
|
35
35
|
response = call(:search_by_region_code_xml, params)
|
36
36
|
get_array(response, :credit_org, :enum_credits)
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
39
|
+
def SearchByName(bank_name) # Метод возвращает nil, либо массив хэшей
|
40
40
|
params = { "NamePart" => bank_name }
|
41
41
|
response = call(:search_by_name_xml, params)
|
42
42
|
get_array(response, :credit_org, :enum_credits)
|
43
43
|
end
|
44
44
|
|
45
|
-
def
|
45
|
+
def GetOffices(int_code)
|
46
46
|
params = { "IntCode" => int_code }
|
47
47
|
response = call(:get_offices_xml, params)
|
48
48
|
get_array(response, :co_offices, :offices)
|
49
49
|
end
|
50
50
|
|
51
|
-
def
|
51
|
+
def GetOfficesByRegion(region_code)
|
52
52
|
params = { "RegCode" => region_code }
|
53
53
|
response = call(:get_offices_by_region_xml, params)
|
54
54
|
get_array(response, :co_offices, :offices)
|
55
55
|
end
|
56
56
|
|
57
|
-
def
|
57
|
+
def EnumBic
|
58
58
|
response = call(:enum_bic_xml)
|
59
59
|
get_array(response, :enum_bic, :bic)
|
60
60
|
end
|
61
61
|
|
62
|
-
def
|
62
|
+
def RegionsEnum
|
63
63
|
response = call(:regions_enum_xml)
|
64
64
|
get_array(response, :regions_enum, :rgid)
|
65
65
|
end
|
66
66
|
|
67
|
-
def
|
67
|
+
def CreditInfoByIntCode(internal_code)
|
68
68
|
params = { "InternalCode" => internal_code }
|
69
69
|
response = call(:credit_info_by_int_code_xml, params)
|
70
70
|
if response.nil?
|
data/rus_bank.gemspec
CHANGED
@@ -2,14 +2,16 @@
|
|
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: rus_bank 0.9.1 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
8
|
s.name = "rus_bank"
|
8
|
-
s.version = "0.9.
|
9
|
+
s.version = "0.9.1"
|
9
10
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
11
13
|
s.authors = ["wilDAlex"]
|
12
|
-
s.date = "
|
14
|
+
s.date = "2014-01-17"
|
13
15
|
s.description = "\u{41d}\u{430}\u{431}\u{43e}\u{440} ruby-\u{43c}\u{435}\u{442}\u{43e}\u{434}\u{43e}\u{432} \u{434}\u{43b}\u{44f} \u{440}\u{430}\u{431}\u{43e}\u{442}\u{44b} \u{441} \u{441}\u{435}\u{440}\u{432}\u{438}\u{441}\u{430}\u{43c}\u{438} \u{426}\u{411} \u{420}\u{424}"
|
14
16
|
s.email = "some@wild-x.ru"
|
15
17
|
s.extra_rdoc_files = [
|
@@ -31,8 +33,7 @@ Gem::Specification.new do |s|
|
|
31
33
|
]
|
32
34
|
s.homepage = "http://github.com/wildDAlex/rus_bank"
|
33
35
|
s.licenses = ["MIT"]
|
34
|
-
s.
|
35
|
-
s.rubygems_version = "2.0.6"
|
36
|
+
s.rubygems_version = "2.2.1"
|
36
37
|
s.summary = "Ruby-\u{438}\u{43d}\u{442}\u{435}\u{440}\u{444}\u{435}\u{439}\u{441} \u{434}\u{43b}\u{44f} \u{43f}\u{43e}\u{43b}\u{443}\u{447}\u{435}\u{43d}\u{438}\u{44f} \u{438}\u{43d}\u{444}\u{43e}\u{440}\u{43c}\u{430}\u{446}\u{438}\u{438} \u{43f}\u{43e} \u{440}\u{43e}\u{441}\u{441}\u{438}\u{439}\u{441}\u{43a}\u{438}\u{43c} \u{431}\u{430}\u{43d}\u{43a}\u{430}\u{43c}"
|
37
38
|
|
38
39
|
if s.respond_to? :specification_version then
|
data/test/test_rus_bank.rb
CHANGED
@@ -46,44 +46,44 @@ class TestRusBank < Test::Unit::TestCase
|
|
46
46
|
end
|
47
47
|
|
48
48
|
should ":enum_bic_xml returns array of elements" do
|
49
|
-
assert(@cbr.
|
50
|
-
assert(@cbr.
|
49
|
+
assert(@cbr.EnumBic.instance_of?(Array), "This should be array")
|
50
|
+
assert(@cbr.EnumBic.length > 100, "This should return more than 100 elements")
|
51
51
|
end
|
52
52
|
|
53
53
|
should ":regions_enum_xml returns array of elements" do
|
54
|
-
assert(@cbr.
|
55
|
-
assert(@cbr.
|
54
|
+
assert(@cbr.RegionsEnum.instance_of?(Array), "This should be array")
|
55
|
+
assert(@cbr.RegionsEnum.length > 70, "This should return more than 70 elements")
|
56
56
|
end
|
57
57
|
|
58
58
|
should ":search_by_region_code_xml returns array of elements" do
|
59
|
-
assert(@cbr.
|
60
|
-
assert(@cbr.
|
61
|
-
assert_equal(nil, @cbr.
|
59
|
+
assert(@cbr.SearchByRegionCode(VALID_REGION).instance_of?(Array), "This should be array")
|
60
|
+
assert(@cbr.SearchByRegionCode(VALID_REGION).length > 10, "This should return more than 10 banks")
|
61
|
+
assert_equal(nil, @cbr.SearchByRegionCode(INVALID_REGION), "Should return nil if value not found")
|
62
62
|
end
|
63
63
|
|
64
64
|
should ":search_by_name_xml return correct value" do
|
65
|
-
assert(@cbr.
|
66
|
-
assert_equal(VALID_ORG_NAME, @cbr.
|
67
|
-
assert_equal(nil, @cbr.
|
65
|
+
assert(@cbr.SearchByName(VALID_ORG_NAME).instance_of?(Array), "This should be array")
|
66
|
+
assert_equal(VALID_ORG_NAME, @cbr.SearchByName(VALID_ORG_NAME).first[:org_name])
|
67
|
+
assert_equal(nil, @cbr.SearchByName(INVALID_ORG_NAME), "Should return nil if value not found")
|
68
68
|
end
|
69
69
|
|
70
70
|
should ":get_offices_xml returns array of elements" do
|
71
|
-
assert(@cbr.
|
72
|
-
assert(@cbr.
|
73
|
-
assert_equal(nil, @cbr.
|
71
|
+
assert(@cbr.GetOffices(VALID_INT_CODE).instance_of?(Array), "This should be array")
|
72
|
+
assert(@cbr.GetOffices(VALID_INT_CODE).length > 2, "This should return more than 2 offices")
|
73
|
+
assert_equal(nil, @cbr.GetOffices(INVALID_INT_CODE), "Should return nil if value not found")
|
74
74
|
end
|
75
75
|
|
76
76
|
should ":get_offices_by_region_xml returns array of elements" do
|
77
|
-
assert(@cbr.
|
78
|
-
assert(@cbr.
|
79
|
-
assert_equal(nil, @cbr.
|
77
|
+
assert(@cbr.GetOfficesByRegion(VALID_REGION).instance_of?(Array), "This should be array")
|
78
|
+
assert(@cbr.GetOfficesByRegion(VALID_REGION).length > 10, "This should return more than 10 offices")
|
79
|
+
assert_equal(nil, @cbr.GetOfficesByRegion(INVALID_REGION), "Should return nil if value not found")
|
80
80
|
end
|
81
81
|
|
82
82
|
should ":credit_info_by_int_code_xml return correct bank" do
|
83
|
-
assert_equal(VALID_REG_NUMBER, @cbr.
|
84
|
-
assert_equal(VALID_ORG_NAME, @cbr.
|
85
|
-
assert_equal(VALID_BIC, @cbr.
|
86
|
-
assert_equal(nil, @cbr.
|
83
|
+
assert_equal(VALID_REG_NUMBER, @cbr.CreditInfoByIntCode(VALID_INT_CODE)[:co][:reg_number])
|
84
|
+
assert_equal(VALID_ORG_NAME, @cbr.CreditInfoByIntCode(VALID_INT_CODE)[:co][:org_name])
|
85
|
+
assert_equal(VALID_BIC, @cbr.CreditInfoByIntCode(VALID_INT_CODE)[:co][:bic])
|
86
|
+
assert_equal(nil, @cbr.CreditInfoByIntCode(INVALID_INT_CODE), "Should return nil if value not found")
|
87
87
|
end
|
88
88
|
|
89
89
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rus_bank
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- wilDAlex
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
121
|
rubyforge_project:
|
122
|
-
rubygems_version: 2.
|
122
|
+
rubygems_version: 2.2.1
|
123
123
|
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: Ruby-интерфейс для получения информации по российским банкам
|