Sha256: 5e98665195cd2c2403e7c8a9c02812db5c4bb41257913da84755c6c56bd07c1a

Contents?: true

Size: 691 Bytes

Versions: 13

Compression:

Stored size: 691 Bytes

Contents

# frozen_string_literal: true
module FinApps
  module REST
    class OperatorsPasswordResets < FinAppsCore::REST::Resources
      def create(params, path=nil)
        not_blank(params, :params)
        validates_email(params) if path.nil?

        path ||= 'operators/password/forgot'

        super params, path
      end

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

        path = 'operators/password/reset'
        create params, path
      end

      private

      def validates_email(params)
        unless params.key?(:email) && params[:email]
          raise FinAppsCore::InvalidArgumentsError.new 'Invalid argument: params.'
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
finapps-2.2.22 lib/finapps/rest/operators_password_resets.rb
finapps-2.2.21 lib/finapps/rest/operators_password_resets.rb
finapps-2.2.20 lib/finapps/rest/operators_password_resets.rb
finapps-2.2.19 lib/finapps/rest/operators_password_resets.rb
finapps-2.2.18 lib/finapps/rest/operators_password_resets.rb
finapps-2.2.17 lib/finapps/rest/operators_password_resets.rb
finapps-2.2.16 lib/finapps/rest/operators_password_resets.rb
finapps-2.2.15 lib/finapps/rest/operators_password_resets.rb
finapps-2.2.14 lib/finapps/rest/operators_password_resets.rb
finapps-2.2.13 lib/finapps/rest/operators_password_resets.rb
finapps-2.2.12 lib/finapps/rest/operators_password_resets.rb
finapps-2.2.11 lib/finapps/rest/operators_password_resets.rb
finapps-2.2.10 lib/finapps/rest/operators_password_resets.rb