Class: Assets::Environment::Dynamic

Inherits:
Assets::Environment show all
Includes:
Adamantium
Defined in:
lib/assets/environment/dynamic.rb

Overview

Environment with dynamic asset compilation

Instance Method Summary collapse

Methods inherited from Assets::Environment

#url

Instance Method Details

#get(name) ⇒ Asset?

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.

Return asset for name

Parameters:

  • name (String)

Returns:

  • (Asset)

    if found

  • (nil)

    otherwise



49
50
51
52
# File 'lib/assets/environment/dynamic.rb', line 49

def get(name)
  rule = rule(name)
  rule && rule.asset
end

#indexHash

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.

Return index

Returns:

  • (Hash)


14
15
16
17
18
# File 'lib/assets/environment/dynamic.rb', line 14

def index
  rules.each_with_object({}) do |rule, index|
    index[rule.name] = rule
  end
end

#rule(name) ⇒ Rule?

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.

Return rule for name

Parameters:

  • name (String)

Returns:

  • (Rule)

    if found

  • (nil)

    otherwise



33
34
35
# File 'lib/assets/environment/dynamic.rb', line 33

def rule(name)
  index[name]
end