Sha256: 5299319781ee64ea44ce29444b747b92f8f98abb25578f4577768f898accf706

Contents?: true

Size: 692 Bytes

Versions: 16

Compression:

Stored size: 692 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

16 entries across 16 versions & 1 rubygems

Version Path
finapps-4.0.3 lib/finapps/rest/operators_password_resets.rb
finapps-4.0.2 lib/finapps/rest/operators_password_resets.rb
finapps-4.0.1 lib/finapps/rest/operators_password_resets.rb
finapps-3.0.7 lib/finapps/rest/operators_password_resets.rb
finapps-3.0.6 lib/finapps/rest/operators_password_resets.rb
finapps-3.0.5 lib/finapps/rest/operators_password_resets.rb
finapps-3.0.4 lib/finapps/rest/operators_password_resets.rb
finapps-3.0.3 lib/finapps/rest/operators_password_resets.rb
finapps-3.0.2 lib/finapps/rest/operators_password_resets.rb
finapps-3.0.1 lib/finapps/rest/operators_password_resets.rb
finapps-2.3.7 lib/finapps/rest/operators_password_resets.rb
finapps-2.3.6 lib/finapps/rest/operators_password_resets.rb
finapps-2.3.5 lib/finapps/rest/operators_password_resets.rb
finapps-2.3.3 lib/finapps/rest/operators_password_resets.rb
finapps-2.3.2 lib/finapps/rest/operators_password_resets.rb
finapps-2.3.1 lib/finapps/rest/operators_password_resets.rb