Module: DynamicAssets::Config
- Included in:
- Manager
- Defined in:
- lib/dynamic_assets/config.rb
Constant Summary collapse
- CONFIG_VARS =
%w(combine_asset_groups minify cache)
Instance Method Summary collapse
- #asset_reference_for_name(type, name) ⇒ Object
-
#asset_references_for_group_key(type, group_key) ⇒ Object
Asset Queries.
- #cache? ⇒ Boolean
-
#combine_asset_groups? ⇒ Boolean
Configuration Queries.
- #init(yml_path) ⇒ Object
- #minify? ⇒ Boolean
Instance Method Details
#asset_reference_for_name(type, name) ⇒ Object
35 36 37 |
# File 'lib/dynamic_assets/config.rb', line 35 def asset_reference_for_name(type, name) assets_hash[type].if_present { |gs| gs[:by_name][name] } end |
#asset_references_for_group_key(type, group_key) ⇒ Object
Asset Queries
31 32 33 |
# File 'lib/dynamic_assets/config.rb', line 31 def asset_references_for_group_key(type, group_key) assets_hash[type].if_present { |gs| gs[:by_group][group_key.to_sym] } end |
#cache? ⇒ Boolean
24 25 26 |
# File 'lib/dynamic_assets/config.rb', line 24 def cache? @cache.nil? ? true : @cache end |
#combine_asset_groups? ⇒ Boolean
Configuration Queries
16 17 18 |
# File 'lib/dynamic_assets/config.rb', line 16 def combine_asset_groups? @combine_asset_groups.nil? ? true : @combine_asset_groups end |
#init(yml_path) ⇒ Object
8 9 10 11 |
# File 'lib/dynamic_assets/config.rb', line 8 def init(yml_path) @yml_path = yml_path assets_hash.present? end |
#minify? ⇒ Boolean
20 21 22 |
# File 'lib/dynamic_assets/config.rb', line 20 def minify? @minify.nil? ? true : @minify end |