Sha256: fdf058f79c0ff10015262e033a048e8c9ba63eb7c2a02c4427d8e312affa98de

Contents?: true

Size: 593 Bytes

Versions: 7

Compression:

Stored size: 593 Bytes

Contents

# frozen_string_literal: true
module FinApps
  module REST
    class Sessions < FinAppsCore::REST::Resources # :nodoc:
      using ObjectExtensions
      using StringExtensions

      # @param [Hash] params
      # @return [Array<String>]
      def create(params)
        raise FinAppsCore::InvalidArgumentsError.new 'Invalid argument: params.' unless validates params

        super params, 'login'
      end

      private

      def validates(params)
        params.key?(:email) && params[:email].present? && params.key?(:password) && params[:password].present?
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
finapps-2.2.7 lib/finapps/rest/sessions.rb
finapps-2.2.6 lib/finapps/rest/sessions.rb
finapps-2.2.5 lib/finapps/rest/sessions.rb
finapps-2.2.4 lib/finapps/rest/sessions.rb
finapps-2.2.3 lib/finapps/rest/sessions.rb
finapps-2.2.2 lib/finapps/rest/sessions.rb
finapps-2.2.1 lib/finapps/rest/sessions.rb