Git Product home page Git Product logo

kps's Introduction

Kps

Bu gem Ondokuz Mayıs Üniversitesi BİDB tarafından sunulan kimlik paylaşım sistemin ruby istemcisidir.

Installation

Uygulamanızın Gemfile dosyasına aşağıdaki satırı ekleyin;

gem 'kps', git: '[email protected]:uzem/kps.git'

ve aşağıdaki kodu çalıştırın:

$ bundle

Veya kendiniz aşağıdaki gibi yükleyin:

$ gem install kps

Configuration

Rails uygulamanızda config/initializers/kps_configure.rb dosyası oluştururak aşağıdaki kodları içisine yapıştırınız.

  Kps.configure do |config|
    config.wsdl = "http://foo.bar.com?wsql"
    config.open_timeout = 30 # Default 30
    config.read_timeout = 30 # Default 30
    config.ssl_verify_mode = nil
  end

Veya

WSDL adresini ayrıca ortam değişkenleri yoluyla da değiştirebilirsiniz

export KPS_WSDL_URL="http://foo.bar.com?wsql"

Kullanım

Bu gem iki tür bilginin kimlik paylaşım sistemi üzerinden çekilmesini sağlar.

Kişi Bilgisi

Kps.query({ tc: 12345678901, gun: 1, ay: 2, yil: 2022 })

# Response
<Kps::Person:0x007f3657c1f270
 @birthday=#<Date: 1900-01-01 ((2448867j,0s,0n),+0s,2299161j)>,
 @date_of_death=nil,
 @father_name="Father Name",
 @first_name="Bla",
 @gender="Erkek",
 @identity_number="12345678901",
 @last_name="Foo",
 @marital_status="Bekâr",
 @mother_name="Mother Name",
 @nationality="Türkiye Cumhuriyeti Devleti",
 @place_of_birth="ATAKUM">

Veya

Kps::Query.identity({ tc: 12345678901, gun: 1, ay: 2, yil: 2022 })

Kişinin, türk vatandaşı veya yabancı uyruklu olup olmadığını aşağıdaki methodlar üzerinden öğrenebilirsiniz.

person = Kps.query({ tc: 12345678901, gun: 1, ay: 2, yil: 2022 })
person.turkish? # true or false
person.foreign? # true or false

Adres Bilgisi

Kps.query({ tc: 12345678901, gun: 1, ay: 2, yil: 2022 }, :adres_bilgisi)

# Response
<Kps::Address:0x007f3656b658d0
 @address="Ondokuz Mayıs Üniversitesi Uzaktan Eğitim Merkezi ATAKUM/SAMSUN",
 @apartment_number="55",
 @city="SAMSUN",
 @identity_number="12345678901",
 @inner_door_number="1",
 @neighborhood="Kurupelit",
 @street="1. Sokak",
 @town="ATAKUM">

Veya

Kps::Query.address({ tc: 12345678901, gun: 1, ay: 2, yil: 2022 })

Adres bilgilerini kişi bilgileri klasında bulunan address metodu ile öğrenebilirsiniz.

person = Kps.query({ tc: 12345678901, gun: 1, ay: 2, yil: 2022 })
person.address

License

The gem is available as open source under the terms of the MIT License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.