<commit_before>require_relative 'user_base'
require_relative '../identifiable'

module Lobster
  module Users

    # Basic information about a someone using the service.
    class User < UserBase
      include Identifiable

      # Date and time the user last logged in.
      # This can also be thought of as the last time the user went from offline to online.
      # @note This attribute will be +nil+ if a user hasn't logged in.
      # @return [Time, nil]
      attr_accessor :last_login

      # Date and time the member registered an account.
      # This attribute will be +nil+ for guests, since they have not registered.
      # @return [Time, nil]
      attr_accessor :registration

      # Indicates whether the user is actively using the service.
      def online?
        @is_online
      end

      # Indicates the security level of the user.
      # This attribute is used when checking permissions.
      # @return [Symbol] One of:
      #   - +:guest+  - Does not have a registered account.
      #   - +:member+ - Has a registered account, but not a staff member.
      #   - +:mod+    - Basic staff member.
      #   - +:admin+  - Higher staff member - typically a server owner.
      #   - +:super+  - Internal user.
      attr_accessor :clearance

      # Indicates whether the user has a registered account.
      # @return [Boolean] +true+ if the user *does not* have an account.
      def guest?
        clearance == :guest
      end

      # Indicates whether the user has a registered account.
      # @return [Boolean] +true+ if the user *does* have an account.
      # @note All staff members are considered members except super users.
      def member?
        !registration.nil?<commit_msg>Attributes should be read-only<commit_after>require_relative 'user_base'
require_relative '../identifiable'

module Lobster
  module Users

    # Basic information about a someone using the service.
    class User < UserBase
      include Identifiable

      # Date and time the user last logged in.
      # This can also be thought of as the last time the user went from offline to online.
      # @note This attribute will be +nil+ if a user hasn't logged in.
      # @return [Time, nil]
      attr_reader :last_login

      # Date and time the member registered an account.
      # This attribute will be +nil+ for guests, since they have not registered.
      # @return [Time, nil]
      attr_reader :registration

      # Indicates whether the user is actively using the service.
      def online?
        @is_online
      end

      # Indicates the security level of the user.
      # This attribute is used when checking permissions.
      # @return [Symbol] One of:
      #   - +:guest+  - Does not have a registered account.
      #   - +:member+ - Has a registered account, but not a staff member.
      #   - +:mod+    - Basic staff member.
      #   - +:admin+  - Higher staff member - typically a server owner.
      #   - +:super+  - Internal user.
      attr_reader :clearance

      # Indicates whether the user has a registered account.
      # @return [Boolean] +true+ if the user *does not* have an account.
      def guest?
        clearance == :guest
      end

      # Indicates whether the user has a registered account.
      # @return [Boolean] +true+ if the user *does* have an account.
      # @note All staff members are considered members except super users.
      def member?
        !registration.nil?
{'fraction_non_alphanumeric': 0.07326962061975094, 'fraction_numerical': 0.0, 'mean_word_length': 2.3436592449177156, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6507237', 'n_tokens_mistral': 931, 'n_tokens_neox': 906, 'n_words': 418}