Module: Legion::Extensions::MicrosoftTeams::Runners::LocalCache
- Includes:
- Helpers::Lex
- Included in:
- Client
- Defined in:
- lib/legion/extensions/microsoft_teams/runners/local_cache.rb
Instance Method Summary collapse
-
#extract_local_messages(db_path: nil, since: nil, channels: nil, senders: nil, skip_bots: true) ⇒ Object
Extract messages from the local Teams LevelDB cache.
-
#local_cache_available?(db_path: nil) ⇒ Boolean
Check if the local Teams cache is available.
-
#local_cache_stats(db_path: nil) ⇒ Object
Get stats about the local Teams cache without extracting messages.
Instance Method Details
#extract_local_messages(db_path: nil, since: nil, channels: nil, senders: nil, skip_bots: true) ⇒ Object
Extract messages from the local Teams LevelDB cache. Works offline without Graph API credentials.
16 17 18 19 20 21 22 23 |
# File 'lib/legion/extensions/microsoft_teams/runners/local_cache.rb', line 16 def (db_path: nil, since: nil, channels: nil, senders: nil, skip_bots: true, **) opts = {} opts[:db_path] = db_path if db_path extractor = MicrosoftTeams::LocalCache::Extractor.new(**opts) = extractor.extract(since: since, channels: channels, senders: senders, skip_bots: skip_bots) { result: .map { |m| (m) } } end |
#local_cache_available?(db_path: nil) ⇒ Boolean
Check if the local Teams cache is available.
26 27 28 29 30 31 |
# File 'lib/legion/extensions/microsoft_teams/runners/local_cache.rb', line 26 def local_cache_available?(db_path: nil, **) opts = {} opts[:db_path] = db_path if db_path extractor = MicrosoftTeams::LocalCache::Extractor.new(**opts) { result: extractor.available? } end |
#local_cache_stats(db_path: nil) ⇒ Object
Get stats about the local Teams cache without extracting messages.
34 35 36 37 38 39 |
# File 'lib/legion/extensions/microsoft_teams/runners/local_cache.rb', line 34 def local_cache_stats(db_path: nil, **) opts = {} opts[:db_path] = db_path if db_path extractor = MicrosoftTeams::LocalCache::Extractor.new(**opts) { result: extractor.stats } end |