From f8a9f67ea31bb931003f858124f682a3aae6bec3 Mon Sep 17 00:00:00 2001 From: msdundar Date: Sun, 5 Aug 2018 22:16:15 +0300 Subject: [PATCH] Add a sample endpoint for API restriction checks --- .../yoksis/v4/universiteleri_birimler.rb | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 app/services/yoksis/v4/universiteleri_birimler.rb diff --git a/app/services/yoksis/v4/universiteleri_birimler.rb b/app/services/yoksis/v4/universiteleri_birimler.rb new file mode 100644 index 000000000..8f2204bf2 --- /dev/null +++ b/app/services/yoksis/v4/universiteleri_birimler.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Services + module Yoksis + module V4 + # client = Services::Yoksis::V4::UniversiteBirimler.new + class UniversiteBirimler + def initialize + wsdl = 'http://servisler.yok.gov.tr/ws/UniversiteBirimlerv4?WSDL' + + @client = Savon.client( + wsdl: wsdl, + convert_request_keys_to: :camelcase, + basic_auth: [Rails.application.credentials.yoksis[:user], Rails.application.credentials.yoksis[:password]] + ) + end + + # alias: list_countries + def universiteleri_getirv4 + @client.call(__method__).body + end + + alias universities universiteleri_getirv4 + end + end + end +end