class Logtail::Contexts::User

@private

Attributes

email[R]
id[R]
name[R]

Public Class Methods

new(attributes) click to toggle source
# File lib/logtail/contexts/user.rb, line 10
def initialize(attributes)
  @id = attributes[:id]
  @name = attributes[:name]
  @email = attributes[:email]
end

Public Instance Methods

to_hash() click to toggle source

Builds a hash representation containing simple objects, suitable for serialization (JSON).

# File lib/logtail/contexts/user.rb, line 17
def to_hash
  @to_hash ||= {
    user: Util::NonNilHashBuilder.build do |h|
      h.add(:id, id)
      h.add(:name, name)
      h.add(:email, email)
    end
  }
end