Sha256: 8e6a09166a1840e22e630d75a18f7591587b04c7afab055fdd53240dac3a65ef

Contents?: true

Size: 576 Bytes

Versions: 13

Compression:

Stored size: 576 Bytes

Contents

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

      # @param [Hash] params
      # @return [Array<String>]
      def create(params)
        raise 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

13 entries across 13 versions & 1 rubygems

Version Path
finapps-2.1.4 lib/finapps/rest/sessions.rb
finapps-2.1.3 lib/finapps/rest/sessions.rb
finapps-2.1.2 lib/finapps/rest/sessions.rb
finapps-2.1.1 lib/finapps/rest/sessions.rb
finapps-2.0.30 lib/finapps/rest/sessions.rb
finapps-2.0.29 lib/finapps/rest/sessions.rb
finapps-2.0.28 lib/finapps/rest/sessions.rb
finapps-2.0.27 lib/finapps/rest/sessions.rb
finapps-2.0.26 lib/finapps/rest/sessions.rb
finapps-2.0.25 lib/finapps/rest/sessions.rb
finapps-2.0.24 lib/finapps/rest/sessions.rb
finapps-2.0.23 lib/finapps/rest/sessions.rb
finapps-2.0.22 lib/finapps/rest/sessions.rb