Class: Cinch::CachedList Private

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/cinch/cached_list.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.

Note:

In prior versions, this class was called CacheManager

Since:

  • 2.0.0

Version:

  • 1.1.0

Direct Known Subclasses

ChannelList, UserList

Instance Method Summary collapse

Constructor Details

#initialize(bot) ⇒ CachedList

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 CachedList.

Since:

  • 2.0.0



11
12
13
14
15
# File 'lib/cinch/cached_list.rb', line 11

def initialize(bot)
  @bot = bot
  @cache = {}
  @mutex = Mutex.new
end

Instance Method Details

#each(&block) ⇒ 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.

Since:

  • 2.0.0



17
18
19
# File 'lib/cinch/cached_list.rb', line 17

def each(&block)
  @cache.each_value(&block)
end