Class: PostHog::Utils::SizeLimitedHash Private
- Inherits:
-
Hash
- Object
- Hash
- PostHog::Utils::SizeLimitedHash
- Defined in:
- lib/posthog/utils.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.
Hash that clears itself when it reaches a maximum length.
Instance Method Summary collapse
- #[]=(key, value) ⇒ Object private
-
#initialize(max_length) ⇒ SizeLimitedHash
constructor
private
A new instance of SizeLimitedHash.
Constructor Details
#initialize(max_length) ⇒ SizeLimitedHash
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 SizeLimitedHash.
156 157 158 159 |
# File 'lib/posthog/utils.rb', line 156 def initialize(max_length, ...) super(...) @max_length = max_length end |
Instance Method Details
#[]=(key, value) ⇒ 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.
164 165 166 167 |
# File 'lib/posthog/utils.rb', line 164 def []=(key, value) clear if length >= @max_length super end |