Class: CatHerder::Assets::ErbAsset::ErbContext

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::AssetUrlHelper
Defined in:
lib/cat_herder/assets/erb_asset.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logical_path) ⇒ ErbContext

Returns a new instance of ErbContext.



34
35
36
37
# File 'lib/cat_herder/assets/erb_asset.rb', line 34

def initialize(logical_path)
  @_logical_path = logical_path
  @_dependencies = []
end

Instance Attribute Details

#_dependenciesObject (readonly)

Returns the value of attribute _dependencies.



32
33
34
# File 'lib/cat_herder/assets/erb_asset.rb', line 32

def _dependencies
  @_dependencies
end

Instance Method Details

#compute_asset_path(logical_path) ⇒ Object



39
40
41
# File 'lib/cat_herder/assets/erb_asset.rb', line 39

def compute_asset_path(logical_path, *)
  _dependency(logical_path).asset_path
end

#glob(*logical_patterns, &block) ⇒ Object



51
52
53
# File 'lib/cat_herder/assets/erb_asset.rb', line 51

def glob(*logical_patterns, &block)
  Assets.glob(*logical_patterns.map { |pattern| _expand_logical_path(pattern) }, &block)
end

#render(logical_path) ⇒ Object



47
48
49
# File 'lib/cat_herder/assets/erb_asset.rb', line 47

def render(logical_path)
  _dependency(logical_path).render
end

#resolve(logical_path) ⇒ Object



43
44
45
# File 'lib/cat_herder/assets/erb_asset.rb', line 43

def resolve(logical_path)
  _dependency(logical_path).source_path
end