Class: WeChat::Bot::CachedList

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/wechat/bot/cached_list.rb

Direct Known Subclasses

ContactList

Instance Method Summary collapse

Constructor Details

#initialize(bot) ⇒ CachedList

Returns a new instance of CachedList.



5
6
7
8
9
# File 'lib/wechat/bot/cached_list.rb', line 5

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

Instance Method Details

#each(&block) ⇒ Object



11
12
13
# File 'lib/wechat/bot/cached_list.rb', line 11

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