Class: Aikido::Zen::Collector::Users Private

Inherits:
Aikido::Zen::CappedMap show all
Defined in:
lib/aikido/zen/collector/users.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Keeps track of the users that were seen by the app.

Instance Attribute Summary

Attributes inherited from Aikido::Zen::CappedMap

#capacity

Instance Method Summary collapse

Methods inherited from Aikido::Zen::CappedMap

#[], #[]=, #fetch

Constructor Details

#initialize(config = Aikido::Zen.config) ⇒ Users

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Users.



10
11
12
# File 'lib/aikido/zen/collector/users.rb', line 10

def initialize(config = Aikido::Zen.config)
  super(config.max_users_tracked)
end

Instance Method Details

#add(actor) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Parameters:



16
17
18
19
20
21
22
# File 'lib/aikido/zen/collector/users.rb', line 16

def add(actor)
  if key?(actor.id)
    self[actor.id] |= actor
  else
    self[actor.id] = actor
  end
end

#as_jsonObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



28
29
30
# File 'lib/aikido/zen/collector/users.rb', line 28

def as_json
  map(&:as_json)
end

#each(&blk) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
# File 'lib/aikido/zen/collector/users.rb', line 24

def each(&blk)
  each_value(&blk)
end