tckimlikdogrulama 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,56 +1,4 @@
1
1
  #encoding:utf-8
2
- require "tckimlikdogrulama/version"
2
+ require "tckimlikdogrulama/version"
3
+ require "tckimlikdogrulama/tckimlikdogrula"
3
4
 
4
-
5
- module Tckimlikdogrulama
6
-
7
- module ClassMethods
8
-
9
- def tckimlikno_dogrula(options = {})
10
- client = Savon::Client.new("https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx?WSDL")
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]}}
12
- unless res.body[:tc_kimlik_no_dogrula_response][:tc_kimlik_no_dogrula_result]
13
- false
14
- else
15
- true
16
- end
17
- end
18
-
19
- end
20
-
21
- module InstanceMethods
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
- first_name = eval("self.#{options[:first_name]}")
28
- last_name = eval("self.#{options[:last_name]}")
29
- identification_number = eval("self.#{options[:identification_number]}")
30
- birth_year = eval("self.#{options[:birth_year]}")
31
- res = client.request(:tc_kimlik_no_dogrula) {soap.body = { "TCKimlikNo" => identification_number, "Ad" => UnicodeUtils.upcase(first_name, :tr) , "Soyad" => UnicodeUtils.upcase(last_name, :tr), "DogumYili" => birth_year}}
32
- else
33
- 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}}
34
- end
35
-
36
- unless res.body[:tc_kimlik_no_dogrula_response][:tc_kimlik_no_dogrula_result]
37
- false
38
- else
39
- true
40
- end
41
- end
42
-
43
- end
44
-
45
- def self.included(receiver)
46
- receiver.extend ClassMethods
47
- receiver.send :include, InstanceMethods
48
- end
49
-
50
-
51
- end
52
-
53
-
54
- class ActiveRecord::Base
55
- include Tckimlikdogrulama
56
- end
@@ -1,3 +1,3 @@
1
1
  module Tckimlikdogrulama
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
- require "tckimlikdogrulama/version"
3
+ require "tckimlikdogrulama/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "tckimlikdogrulama"
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.2.1
4
+ version: 0.2.2
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: &70293565539580 !ruby/object:Gem::Requirement
16
+ requirement: &70354147943120 !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: *70293565539580
24
+ version_requirements: *70354147943120
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: unicode_utils
27
- requirement: &70293565533300 !ruby/object:Gem::Requirement
27
+ requirement: &70354147942680 !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: *70293565533300
35
+ version_requirements: *70354147942680
36
36
  description: Ad, Soyad, TCKimlikNo ve DogumYili ile Dogrulama Yapar
37
37
  email:
38
38
  - guzelmurat@gmail.com