turkish_banks 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3351bbb1f0bbaf04a00bb9eb3813cf39986b64f
4
- data.tar.gz: 10661cc4cf2c752a2f93d663315cb8d051e7826b
3
+ metadata.gz: ca42c14b39a614002531ce11b1725e0cccf081ab
4
+ data.tar.gz: ab14ff70a0ea3c418e9f4e73bacce962e5f6e8a7
5
5
  SHA512:
6
- metadata.gz: 792e35e48a97fe56ada269261b3eb1d5177387a7077ae3c1725d2408697f8425757d185ff90437c1b3603451ccdee83743ac0a532aecacadb8f36d1f24cafd6c
7
- data.tar.gz: 3a44fef7378f2273b2a745ffbe5ffa1bcfe700205e16b2b28454e615cb055d881b0168ef848a878378066b958dca30d5c40e6d9359dd3c0732ac792ffc543128
6
+ metadata.gz: 3d7a6f65122b6074ff253051fb8420ab074dc975a730973775700498c7e6fc74c7cf226f67098a2eeb14f6b10d75f42e56aa5e1f3fab29fbceb2ea35ef58123c
7
+ data.tar.gz: eb9c06486ceaaa47ca041c0ade0d2a2974cbc800284a5c81fcdc22c740e6ac29f7fbc70271b93d20d72744c40cfca5bb6607af83b4b0c206786922163f5546fa
data/Gemfile CHANGED
@@ -4,6 +4,6 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  group :development, :test do
7
- gem 'pry', '~> 0.9.12'
7
+ gem 'pry', '~> 0.10.0'
8
8
  gem 'rspec', '>= 2.14'
9
9
  end
@@ -1,8 +1,8 @@
1
1
  module TurkishBanks
2
2
  class Bank < TurkishBank
3
3
  attr_accessor :name, :code, :city, :address
4
-
5
- def initialize bank
4
+
5
+ def initialize(bank)
6
6
  @name = bank["bAd"]
7
7
  @code = bank["bKd"]
8
8
  @city = bank["bIlAd"]
@@ -1,8 +1,8 @@
1
1
  module TurkishBanks
2
2
  class Branch < TurkishBank
3
3
  attr_accessor :name, :code, :bank_code, :city
4
-
5
- def initialize branch
4
+
5
+ def initialize(branch)
6
6
  @name = branch["sAd"]
7
7
  @code = branch["sKd"]
8
8
  @bank_code = branch["bKd"]
@@ -5,22 +5,22 @@ module TurkishBanks
5
5
  using TurkishSupport
6
6
  attr_accessor :last_update_date, :banks
7
7
 
8
- BANKS_URL = "http://eftemkt.tcmb.gov.tr/bankasubelistesi/bankaSubeTumListe.xml"
8
+ BANKS_URL = "http://eftemkt.tcmb.gov.tr/bankasubelistesi/bankaSubeTumListe.xml".freeze
9
9
 
10
10
  def initialize
11
11
  doc = Nokogiri.XML(open(BANKS_URL), nil, 'UTF-8')
12
12
  doc.remove_namespaces!
13
- response = Hash.from_xml(doc.to_s)
13
+ response = Hash.from_xml(doc.to_s)
14
14
  @last_update_date = response["bankaSubeTumListe"]["tarih"]
15
- @banks = response["bankaSubeTumListe"]["bankaSubeleri"]
15
+ @banks = response["bankaSubeTumListe"]["bankaSubeleri"]
16
16
  end
17
17
 
18
- def get_information_of bank_name
18
+ def get_information_of(bank_name)
19
19
  bank = get_bank(bank_name).first["banka"]
20
20
  TurkishBanks::Bank.new bank
21
21
  end
22
22
 
23
- def get_branches_of bank_name
23
+ def get_branches_of(bank_name)
24
24
  branches = get_bank(bank_name).first["sube"]
25
25
  branches.each do |branch|
26
26
  TurkishBanks::Branch.new branch
@@ -28,8 +28,7 @@ module TurkishBanks
28
28
  end
29
29
 
30
30
  private
31
-
32
- def get_bank bank_name
31
+ def get_bank(bank_name)
33
32
  @banks.select {|b| b["banka"]["bAd"] == bank_name.upcase}
34
33
  end
35
34
  end
@@ -1,3 +1,3 @@
1
1
  module TurkishBanks
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -24,8 +24,8 @@ Gem::Specification.new do |spec|
24
24
  spec.require_paths = ["lib"]
25
25
 
26
26
  spec.add_development_dependency "bundler", "~> 1.8"
27
- spec.add_development_dependency "rake", "~> 10.0"
28
- spec.add_development_dependency "nokogiri", "~> 1.6.0"
27
+ spec.add_development_dependency "rake", "~> 12.0"
28
+ spec.add_development_dependency "nokogiri", "~> 1.7.0"
29
29
  spec.add_development_dependency "activesupport"
30
30
  spec.add_development_dependency "turkish_support"
31
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turkish_banks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ender Ahmet Yurt
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-19 00:00:00.000000000 Z
11
+ date: 2017-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '12.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '12.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: nokogiri
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.6.0
47
+ version: 1.7.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.6.0
54
+ version: 1.7.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: activesupport
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -123,9 +123,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  version: '0'
124
124
  requirements: []
125
125
  rubyforge_project:
126
- rubygems_version: 2.2.1
126
+ rubygems_version: 2.6.8
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Fetch Turkish Banks and their branches.
130
130
  test_files: []
131
- has_rdoc: