Class: Raygun::AffectedUser

Inherits:
Object
  • Object
show all
Defined in:
lib/raygun/affected_user.rb

Constant Summary collapse

DEFAULT_MAPPING =
{
  identifier: [ :id, :username ],
  email:      :email,
  full_name:  [ :full_name, :name ],
  first_name: :first_name,
  uuid:       :uuid
}.freeze
SUPPORTED_ATTRIBUTES =
DEFAULT_MAPPING.keys.freeze
NAME_TO_RAYGUN_NAME_MAPPING =
{
  identifier: :identifier,
  email: :email,
  full_name: :fullName,
  first_name: :firstName,
  uuid: :uuid
}.freeze

Class Method Summary collapse

Class Method Details

.information_hash(user_object) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/raygun/affected_user.rb', line 21

def information_hash(user_object)
  if user_object.nil? || user_object.is_a?(String)
    handle_anonymous_user(user_object)
  else
    handle_known_user(user_object)
  end
end