Class: Assets::Environment::Static

Inherits:
Assets::Environment show all
Defined in:
lib/assets/environment/static.rb

Overview

Static enviornment with precompiled assets

Instance Method Summary collapse

Methods inherited from Assets::Environment

#rule, #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

Parameters:

  • name (String)

    name of asset

Returns:

  • (Asset)

    if found

  • (nil)

    otherwise



32
33
34
# File 'lib/assets/environment/static.rb', line 32

def get(name)
  index[name]
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)


13
14
15
16
17
# File 'lib/assets/environment/static.rb', line 13

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