Sha256: 67fc548f97b16c10d904b86984342f2bcd4fba195a14240d0a426799b1b45f14

Contents?: true

Size: 549 Bytes

Versions: 11

Compression:

Stored size: 549 Bytes

Contents

# frozen_string_literal: true

module FinApps
  module REST
    class Sessions < FinAppsCore::REST::Resources # :nodoc:
      # @param [Hash] params
      # @return [Array<String>]
      def create(params, path=nil)
        raise FinAppsCore::InvalidArgumentsError.new 'Invalid argument: params.' unless validates params
        path ||= 'login'

        super params, path
      end

      private

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
finapps-3.0.5 lib/finapps/rest/sessions.rb
finapps-3.0.4 lib/finapps/rest/sessions.rb
finapps-3.0.3 lib/finapps/rest/sessions.rb
finapps-3.0.2 lib/finapps/rest/sessions.rb
finapps-3.0.1 lib/finapps/rest/sessions.rb
finapps-2.3.7 lib/finapps/rest/sessions.rb
finapps-2.3.6 lib/finapps/rest/sessions.rb
finapps-2.3.5 lib/finapps/rest/sessions.rb
finapps-2.3.3 lib/finapps/rest/sessions.rb
finapps-2.3.2 lib/finapps/rest/sessions.rb
finapps-2.3.1 lib/finapps/rest/sessions.rb