Sha256: 73d14dd4505899880393030bc78777073c5de654e71d814133b46f030c68e6fa

Contents?: true

Size: 982 Bytes

Versions: 3

Compression:

Stored size: 982 Bytes

Contents

module Trajectory
  class User
    include Virtus

    # @return [Integer] the unique identifier of the User
    # @raise [MissingAttributeError] if id is nil
    attribute :id, Integer, default: lambda { |project, attribute| raise MissingAttributeError.new(project, :id) }
    # @return [String] the full name of the user
    attribute :name, String
    # @return [DateTime] the creation date of the user account
    attribute :created_at, DateTime
    # @return [DateTime] the last modification date of the user account
    attribute :updated_at, DateTime
    # @return [String] the url to the avatar image of the user (uses gravatar)
    attribute :gravatar_url, String
    # @return [String] the email of the user
    attribute :email, String

    # Returns true if two users are the sames i.e they share the same id
    # attribute
    #
    # @param other [User] the other object to compare
    # @return [true, false]
    def ==(other)
      id == other.id
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
trajectory-0.1.2 lib/trajectory/domain/user.rb
trajectory-0.1.1 lib/trajectory/domain/user.rb
trajectory-0.1.0 lib/trajectory/domain/user.rb