require "webhookr/engine"

module Webhookr
  extend ActiveSupport::Autoload

  autoload :InvalidPayloadError
  autoload :AdapterResponse
  autoload :Service
  autoload :VERSION

  class << self
    def config
      if defined?(@config)
        @config
      else
        @config = if defined?(Rails)
          Rails.application.config.webhookr
        else
          ActiveSupport::OrderedOptions.new
        end
      end
    end
  end
end

require "webhookr/engine"

module Webhookr
  extend ActiveSupport::Autoload

  autoload :InvalidPayloadError
  autoload :AdapterResponse
  autoload :Service
  autoload :VERSION

  class << self
    def config
      @config ||= defined?(Rails) ? Rails.application.config.webhookr :
                                    ActiveSupport::OrderedOptions.new
    end
  end
end

Convert config method into a one liner
Convert config method into a one liner
