Sha256: 0bfd5c1ffb2ae6baf9a54d47fac57c2d52276f12a1c9a519705c4f9409b5eb29

Contents?: true

Size: 853 Bytes

Versions: 1

Compression:

Stored size: 853 Bytes

Contents

require 'modelish'

module G5AuthenticationClient

  #A G5 Authentication User
  class User < Modelish::Base
    # @!attribute [rw] email
    #   @return [String]
    #   The user's email address.
    property :email, type: String, required: true

    # @!attribute [rw] password
    #   @return [String]
    #   The user's password.  Required to create a user.
    property :password, type: String

    # @!attribute [rw] password_confirmation
    #   @return [String]
    #   The user's password_confirmation.
    property :password_confirmation, type: String

    # @!attribute [rw] id
    #   @return [Integer]
    #   The user's id.  Not required to create a user.
    property :id, type: Integer

    def validate_for_create!
      validate!
      raise ArgumentError.new("Password required for new user.") unless !password.nil?
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
g5_authentication_client-0.2.0 lib/g5_authentication_client/user.rb