lib/telegram/bot/config_methods.rb in telegram-bot-0.16.1 vs lib/telegram/bot/config_methods.rb in telegram-bot-0.16.3

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + require 'active_support/core_ext/hash/keys' require 'active_support/core_ext/hash/indifferent_access' module Telegram module Bot @@ -42,10 +44,10 @@ # Returns config for .bots method. By default uses `telegram['bots']` section # from `secrets.yml` merging `telegram['bot']` at `:default` key. # # Can be overwritten with .bots_config= - def bots_config + def bots_config # rubocop:disable Metrics/PerceivedComplexity @bots_config ||= if defined?(Rails.application) app = Rails.application store = app.credentials[:telegram] if app.respond_to?(:credentials) store ||= app.secrets[:telegram] if app.respond_to?(:secrets)