Module: Loba::Internal::Platform::WithinRails Private

Defined in:
lib/loba/internal/platform/within_rails.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Internal module for considering Rails

Class Method Summary collapse

Class Method Details

.logger?boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Determines if Rails has its logger defined (generally true)

Returns:

  • (boolean)

    true if Rails.logger is defined



8
9
10
# File 'lib/loba/internal/platform/within_rails.rb', line 8

def logger?
  Internal.boolean_cast(defined?(Rails)) && Internal.boolean_cast(Rails.logger)
end

.production?boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Determines if Rails is running in a production environment

Returns:

  • (boolean)

    true if Rails.env is :production



15
16
17
# File 'lib/loba/internal/platform/within_rails.rb', line 15

def production?
  Internal.boolean_cast(defined?(Rails)) && Rails.env.production?
end