Class: CatHerder::Assets::ErbAsset::ErbContext
- Inherits:
-
Object
- Object
- CatHerder::Assets::ErbAsset::ErbContext
- Includes:
- ActionView::Helpers::AssetUrlHelper
- Defined in:
- lib/cat_herder/assets/erb_asset.rb
Instance Attribute Summary collapse
-
#_dependencies ⇒ Object
readonly
Returns the value of attribute _dependencies.
Instance Method Summary collapse
- #compute_asset_path(logical_path) ⇒ Object
- #glob(*logical_patterns, &block) ⇒ Object
-
#initialize(logical_path) ⇒ ErbContext
constructor
A new instance of ErbContext.
- #render(logical_path) ⇒ Object
- #resolve(logical_path) ⇒ Object
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
#_dependencies ⇒ Object (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| (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 |