lib/lita/adapter.rb in lita-4.0.0.rc1 vs lib/lita/adapter.rb in lita-4.0.0.rc2
- old
+ new
@@ -10,11 +10,11 @@
class << self
# @!attribute [r] required_configs
# A list of configuration keys that are required for the adapter to boot.
# @return [Array]
- # @deprecated Will be removed in Lita 5.0. Use {Lita::Adapter#configuration} instead.
+ # @deprecated Will be removed in Lita 5.0. Use {Lita::Adapter#configuration_builder} instead.
def required_configs
Lita.logger.warn(I18n.t("lita.adapter.required_configs_deprecated"))
@required_configs
end
@@ -44,11 +44,11 @@
def initialize(robot)
@robot = robot
ensure_required_configs
end
#
- # The handler's config object.
+ # The adapter's configuration object.
# @return [Lita::Configuration] The adapter's configuration object.
# @since 4.0.0
def config
robot.config.adapters.public_send(self.class.namespace)
end
@@ -115,11 +115,11 @@
alias_method :t, :translate
private
- # Returns the object used for the adapter's config.
+ # Returns the object used as the adapter's configuration.
def adapter_config
if Lita.version_3_compatibility_mode?
Lita.config.adapter
else
robot.config.adapter
@@ -145,9 +145,10 @@
required_configs.select do |key|
key unless adapter_config[key]
end
end
+ # Access the required configs without triggering the deprecation warning.
def required_configs
self.class.instance_variable_get(:@required_configs)
end
end
end