Module: ActiveMatrix

Defined in:
lib/active_matrix/util/extensions.rb,
lib/active_matrix.rb,
lib/active_matrix/api.rb,
lib/active_matrix/bot.rb,
lib/active_matrix/mxid.rb,
lib/active_matrix/room.rb,
lib/active_matrix/user.rb,
lib/active_matrix/client.rb,
lib/active_matrix/errors.rb,
lib/active_matrix/memory.rb,
lib/active_matrix/logging.rb,
lib/active_matrix/railtie.rb,
lib/active_matrix/version.rb,
lib/active_matrix/response.rb,
lib/active_matrix/client_pool.rb,
lib/active_matrix/memory/base.rb,
lib/active_matrix/util/events.rb,
lib/active_matrix/event_router.rb,
lib/active_matrix/agent_manager.rb,
lib/active_matrix/agent_registry.rb,
lib/active_matrix/util/cacheable.rb,
lib/active_matrix/memory/agent_memory.rb,
lib/active_matrix/memory/global_memory.rb,
lib/active_matrix/memory/conversation_memory.rb,
lib/generators/active_matrix/bot/bot_generator.rb,
lib/generators/active_matrix/install/install_generator.rb

Overview

Time duration helpers are provided by ActiveSupport

Defined Under Namespace

Modules: Bot, Extensions, Generators, Logging, Memory, Response, Rooms, Util Classes: AgentAlreadyRunningError, AgentManager, AgentRegistry, Api, Client, ClientPool, Configuration, ErrorEvent, Event, EventHandlerArray, EventRouter, MXID, MatrixConflictError, MatrixConnectionError, MatrixError, MatrixEvent, MatrixForbiddenError, MatrixNotAuthorizedError, MatrixNotFoundError, MatrixRequestError, MatrixTimeoutError, MatrixTooManyRequestsError, MatrixUnexpectedResponseError, Railtie, Room, User

Constant Summary collapse

Loader =

Set up Zeitwerk loader

Zeitwerk::Loader.for_gem
VERSION =
'0.0.2'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject

Returns the value of attribute config.



21
22
23
# File 'lib/active_matrix.rb', line 21

def config
  @config
end

Class Method Details

.configure {|@config| ... } ⇒ Object

Yields:



23
24
25
26
27
# File 'lib/active_matrix.rb', line 23

def configure
  @config ||= Configuration.new
  yield @config if block_given?
  @config
end

.debug!Object



44
45
46
47
48
49
50
# File 'lib/active_matrix/logging.rb', line 44

def debug!
  logger.level = if defined?(::Rails)
                   :debug
                 else
                   ::Logger::DEBUG
                 end
end

.global_logger?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/active_matrix/logging.rb', line 52

def global_logger?
  @global_logger ||= false
end

.loggerObject



29
30
31
32
33
34
35
36
37
# File 'lib/active_matrix/logging.rb', line 29

def logger
  @logger ||= if defined?(::Rails) && ::Rails.respond_to?(:logger)
                ::Rails.logger
              else
                # Fallback for testing
                require 'logger'
                ::Logger.new($stdout)
              end
end

.logger=(logger) ⇒ Object



39
40
41
42
# File 'lib/active_matrix/logging.rb', line 39

def logger=(logger)
  @logger = logger
  @global_logger = !logger.nil?
end