Module: WithEmbeddedAssets

Defined in:
lib/with_embedded_assets.rb,
lib/with_embedded_assets/railtie.rb,
lib/with_embedded_assets/version.rb

Overview

This module handles the activation of embedding assets.

Defined Under Namespace

Modules: Mixin, ViewHelpers Classes: Processor, Railtie

Constant Summary collapse

VERSION =

The current version of the gem.

"0.1.0"

Class Method Summary collapse

Class Method Details

.enabledBoolean Also known as: enabled?

Checks if the automatic embedding of assets is active.

Returns:

  • (Boolean)

    true if the automatic embedding of assets is active, false otherwise



8
9
10
# File 'lib/with_embedded_assets.rb', line 8

def enabled
  !!Thread.current[THREAD_VARIABLE_KEY]
end

.enabled=(value) ⇒ Object

Sets the automatic embedding of assets on or off.

Parameters:

  • value

    An object that will be evaluated as true or false by double negation (!!value).



16
17
18
# File 'lib/with_embedded_assets.rb', line 16

def enabled=(value)
  Thread.current[THREAD_VARIABLE_KEY] = !!value
end