tckimlikdogrulama 0.1.9 → 0.2.0

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.
@@ -1,3 +1,3 @@
1
1
  module Tckimlikdogrulama
2
- VERSION = "0.1.9"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -4,8 +4,8 @@ require "tckimlikdogrulama/version"
4
4
 
5
5
  module Tckimlikdogrulama
6
6
 
7
- module ClassMethods
8
-
7
+ module ClassMethods
8
+
9
9
  def tckimlikno_dogrula(options = {})
10
10
  client = Savon::Client.new("https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx?WSDL")
11
11
  res = client.request(:tc_kimlik_no_dogrula) {soap.body = { "TCKimlikNo" => options[:identification_number], "Ad" => UnicodeUtils.upcase(options[:first_name], :tr) , "Soyad" => UnicodeUtils.upcase(options[:last_name], :tr), "DogumYili" => options[:birth_year]}}
@@ -14,20 +14,28 @@ module Tckimlikdogrulama
14
14
  else
15
15
  true
16
16
  end
17
- end
18
-
17
+ end
18
+
19
19
  end
20
20
 
21
21
  module InstanceMethods
22
- def tckimlikno_dogrula
23
- client = Savon::Client.new("https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx?WSDL")
24
- res = client.request(:tc_kimlik_no_dogrula) {soap.body = { "TCKimlikNo" => self.identification_number, "Ad" => UnicodeUtils.upcase(self.first_name, :tr) , "Soyad" => UnicodeUtils.upcase(self.last_name, :tr), "DogumYili" => self.birth_year}}
22
+
23
+ def tckimlikno_dogrula(options = {})
24
+ client = Savon::Client.new("https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx?WSDL")
25
+
26
+ if options.present?
27
+ res = client.request(:tc_kimlik_no_dogrula) {soap.body = { "TCKimlikNo" => eval "self.#{options[:identification_number]}", "Ad" => UnicodeUtils.upcase(eval "self.#{options[:first_name]}", :tr) , "Soyad" => UnicodeUtils.upcase(eval "self.#{options[:last_name]}", :tr), "DogumYili" => eval "self.#{options[:birth_year]}"}}
28
+ else
29
+ res = client.request(:tc_kimlik_no_dogrula) {soap.body = { "TCKimlikNo" => self.identification_number, "Ad" => UnicodeUtils.upcase(self.first_name, :tr) , "Soyad" => UnicodeUtils.upcase(self.last_name, :tr), "DogumYili" => self.birth_year}}
30
+ end
31
+
25
32
  unless res.body[:tc_kimlik_no_dogrula_response][:tc_kimlik_no_dogrula_result]
26
33
  false
27
34
  else
28
35
  true
29
36
  end
30
37
  end
38
+
31
39
  end
32
40
 
33
41
  def self.included(receiver)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tckimlikdogrulama
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-12 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: savon
16
- requirement: &70146844606620 !ruby/object:Gem::Requirement
16
+ requirement: &70226641214940 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70146844606620
24
+ version_requirements: *70226641214940
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: unicode_utils
27
- requirement: &70146844606200 !ruby/object:Gem::Requirement
27
+ requirement: &70226641214520 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70146844606200
35
+ version_requirements: *70226641214520
36
36
  description: Ad, Soyad, TCKimlikNo ve DogumYili ile Dogrulama Yapar
37
37
  email:
38
38
  - guzelmurat@gmail.com