Sha256: 68ac8c98d34b70cd5d3253d0c87f2ea4126e3f31b6e804db5226763807bf4bfb

Contents?: true

Size: 1.12 KB

Versions: 32

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

module FinApps
  module REST
    class UserInstitutions < FinAppsCore::REST::Resources # :nodoc:
      def list
        super END_POINT
      end

      def create(site_id, params)
        not_blank(site_id, :site_id)
        not_blank(params, :params)

        path = "institutions/site/#{ERB::Util.url_encode(site_id)}/add"

        super params, path
      end

      def show(id)
        not_blank(id, :id)
        super(id, user_institutions_path(id))
      end

      def credentials_update(id, params)
        update id, params, 'credentials'
      end

      def mfa_update(id, params)
        update id, params, 'mfa'
      end

      def destroy(id)
        not_blank(id, :id)
        super(id, user_institutions_path(id))
      end

      private

      END_POINT = 'institutions/consumer'

      def update(id, params, method)
        not_blank(id, :id)
        not_blank(params, :params)

        path = "#{user_institutions_path(id)}/#{method}"
        super params, path
      end

      def user_institutions_path(id)
        "#{END_POINT}/#{ERB::Util.url_encode(id)}"
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
finapps-5.0.3 lib/finapps/rest/user_institutions.rb
finapps-5.0.2 lib/finapps/rest/user_institutions.rb
finapps-5.0.1 lib/finapps/rest/user_institutions.rb
finapps-5.0.0 lib/finapps/rest/user_institutions.rb
finapps-4.0.16 lib/finapps/rest/user_institutions.rb
finapps-4.0.15 lib/finapps/rest/user_institutions.rb
finapps-4.0.14 lib/finapps/rest/user_institutions.rb
finapps-4.0.12 lib/finapps/rest/user_institutions.rb
finapps-4.0.11 lib/finapps/rest/user_institutions.rb
finapps-4.0.10 lib/finapps/rest/user_institutions.rb
finapps-4.0.9 lib/finapps/rest/user_institutions.rb
finapps-4.0.8 lib/finapps/rest/user_institutions.rb
finapps-4.0.7 lib/finapps/rest/user_institutions.rb
finapps-4.0.6 lib/finapps/rest/user_institutions.rb
finapps-4.0.5 lib/finapps/rest/user_institutions.rb
finapps-4.0.4 lib/finapps/rest/user_institutions.rb
finapps-4.0.3 lib/finapps/rest/user_institutions.rb
finapps-4.0.2 lib/finapps/rest/user_institutions.rb
finapps-4.0.1 lib/finapps/rest/user_institutions.rb
finapps-3.0.7 lib/finapps/rest/user_institutions.rb